blob: fe8e69b71621ad6d8c19a9eaa9ef74561a8845cc [file] [log] [blame]
Junio C Hamanodf60f442007-02-07 05:52:371<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoc14e6ad2014-10-31 20:25:536<meta name="generator" content="AsciiDoc 8.6.9" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-fast-import(1)</title>
Junio C Hamanodf60f442007-02-07 05:52:378<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamanodf60f442007-02-07 05:52:3724}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamanodf60f442007-02-07 05:52:3737
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamanodf60f442007-02-07 05:52:3741}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamanodf60f442007-02-07 05:52:3746}
47
Junio C Hamanodf60f442007-02-07 05:52:3748h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamanodf60f442007-02-07 05:52:3750 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamanodf60f442007-02-07 05:52:3756 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamanodf60f442007-02-07 05:52:3759 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamanodf60f442007-02-07 05:52:3770
71div.sectionbody {
Junio C Hamanodf60f442007-02-07 05:52:3772 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamanoc14e6ad2014-10-31 20:25:5390.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamanodf60f442007-02-07 05:52:3794 padding: 0;
95 margin: 0;
96}
Junio C Hamanoc14e6ad2014-10-31 20:25:5397pre {
98 white-space: pre-wrap;
99}
Junio C Hamanodf60f442007-02-07 05:52:37100
Junio C Hamano9d971152012-12-19 00:43:11101#author {
Junio C Hamanodf60f442007-02-07 05:52:37102 color: #527bbd;
Junio C Hamanodf60f442007-02-07 05:52:37103 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31104 font-size: 1.1em;
Junio C Hamanodf60f442007-02-07 05:52:37105}
Junio C Hamano9d971152012-12-19 00:43:11106#email {
Junio C Hamanodf60f442007-02-07 05:52:37107}
Junio C Hamano9d971152012-12-19 00:43:11108#revnumber, #revdate, #revremark {
Junio C Hamanodf60f442007-02-07 05:52:37109}
110
Junio C Hamano9d971152012-12-19 00:43:11111#footer {
Junio C Hamanodf60f442007-02-07 05:52:37112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116}
Junio C Hamano9d971152012-12-19 00:43:11117#footer-text {
Junio C Hamanodf60f442007-02-07 05:52:37118 float: left;
119 padding-bottom: 0.5em;
120}
Junio C Hamano9d971152012-12-19 00:43:11121#footer-badges {
Junio C Hamanodf60f442007-02-07 05:52:37122 float: right;
123 padding-bottom: 0.5em;
124}
125
Junio C Hamano9d971152012-12-19 00:43:11126#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129}
Junio C Hamano9d971152012-12-19 00:43:11130div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanodf60f442007-02-07 05:52:37131div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22133 margin-top: 1.0em;
Junio C Hamanodf60f442007-02-07 05:52:37134 margin-bottom: 1.5em;
135}
136div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
Junio C Hamanodf60f442007-02-07 05:52:37141}
142
143div.content { /* Block element content. */
144 padding: 0;
145}
146
147/* Block element titles. */
148div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59149 color: #527bbd;
Junio C Hamanodf60f442007-02-07 05:52:37150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154}
155div.title + * {
156 margin-top: 0;
157}
158
159td div.title:first-child {
160 margin-top: 0.0em;
161}
162div.content div.title:first-child {
163 margin-top: 0.0em;
164}
165div.content + div.title {
166 margin-top: 0.0em;
167}
168
169div.sidebarblock > div.content {
170 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
Junio C Hamanodf60f442007-02-07 05:52:37173 padding: 0.5em;
174}
175
176div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
Junio C Hamanodf60f442007-02-07 05:52:37180 padding: 0.5em;
181}
182
Junio C Hamano7bd050f2011-09-22 06:32:22183div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59186 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11187 border-left: 5px solid #f0f0f0;
188 color: #888;
Junio C Hamanodf60f442007-02-07 05:52:37189}
Junio C Hamano7bd050f2011-09-22 06:32:22190
Junio C Hamano68cf15a2010-11-06 01:01:59191div.quoteblock > div.attribution {
192 padding-top: 0.5em;
Junio C Hamanodf60f442007-02-07 05:52:37193 text-align: right;
194}
Junio C Hamano68cf15a2010-11-06 01:01:59195
Junio C Hamano9d971152012-12-19 00:43:11196div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59199}
200div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203}
204/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31205div.verseblock + div.attribution {
206 text-align: left;
207}
Junio C Hamanodf60f442007-02-07 05:52:37208
209div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216}
217div.admonitionblock td.content {
218 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22219 border-left: 3px solid #dddddd;
Junio C Hamanodf60f442007-02-07 05:52:37220}
221
222div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
Junio C Hamanodf60f442007-02-07 05:52:37225}
226
Junio C Hamanodf60f442007-02-07 05:52:37227div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53228span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano68cf15a2010-11-06 01:01:59229a.image:visited { color: white; }
Junio C Hamanodf60f442007-02-07 05:52:37230
231dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234}
235dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59238 font-style: normal;
239 color: navy;
Junio C Hamanodf60f442007-02-07 05:52:37240}
241dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59242 margin-top: 0.1em;
Junio C Hamanodf60f442007-02-07 05:52:37243}
244
245ul, ol {
246 list-style-position: outside;
247}
Junio C Hamano68cf15a2010-11-06 01:01:59248ol.arabic {
249 list-style-type: decimal;
250}
251ol.loweralpha {
Junio C Hamanodf60f442007-02-07 05:52:37252 list-style-type: lower-alpha;
253}
Junio C Hamano68cf15a2010-11-06 01:01:59254ol.upperalpha {
255 list-style-type: upper-alpha;
256}
257ol.lowerroman {
258 list-style-type: lower-roman;
259}
260ol.upperroman {
261 list-style-type: upper-roman;
262}
263
264div.compact ul, div.compact ol,
265div.compact p, div.compact p,
266div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269}
Junio C Hamanodf60f442007-02-07 05:52:37270
Junio C Hamanodf60f442007-02-07 05:52:37271tfoot {
272 font-weight: bold;
273}
Junio C Hamano68cf15a2010-11-06 01:01:59274td > div.verse {
275 white-space: pre;
276}
Junio C Hamano68cf15a2010-11-06 01:01:59277
278div.hdlist {
Junio C Hamanodf60f442007-02-07 05:52:37279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281}
Junio C Hamano68cf15a2010-11-06 01:01:59282div.hdlist tr {
283 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31284}
Junio C Hamano68cf15a2010-11-06 01:01:59285dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287}
288td.hdlist1 {
Junio C Hamanodf60f442007-02-07 05:52:37289 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59290 font-style: normal;
Junio C Hamanodf60f442007-02-07 05:52:37291 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59292 color: navy;
Junio C Hamanodf60f442007-02-07 05:52:37293}
Junio C Hamano68cf15a2010-11-06 01:01:59294td.hdlist2 {
Junio C Hamanodf60f442007-02-07 05:52:37295 vertical-align: top;
296}
Junio C Hamano68cf15a2010-11-06 01:01:59297div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300}
301
302.comment {
303 background: yellow;
304}
Junio C Hamanodf60f442007-02-07 05:52:37305
Junio C Hamano7bd050f2011-09-22 06:32:22306.footnote, .footnoteref {
307 font-size: 0.8em;
308}
309
310span.footnote, span.footnoteref {
311 vertical-align: super;
312}
313
314#footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317}
318
319#footnotes div.footnote {
320 margin: 0 0 5px 0;
321}
322
323#footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331}
332
Junio C Hamano9d971152012-12-19 00:43:11333div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337}
338div.colist td img {
339 margin-top: 0.3em;
Junio C Hamanodf60f442007-02-07 05:52:37340}
Junio C Hamanoba4b9282008-07-06 05:20:31341
Junio C Hamano9d971152012-12-19 00:43:11342@media print {
343 #footer-badges { display: none; }
344}
345
346#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22347 margin-bottom: 2.5em;
348}
349
Junio C Hamano9d971152012-12-19 00:43:11350#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31351 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356}
357
Junio C Hamanoc14e6ad2014-10-31 20:25:53358div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31359 margin-top: 0;
360 margin-bottom: 0;
361}
362div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365}
366div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369}
370div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373}
Junio C Hamano9d971152012-12-19 00:43:11374
375span.aqua { color: aqua; }
376span.black { color: black; }
377span.blue { color: blue; }
378span.fuchsia { color: fuchsia; }
379span.gray { color: gray; }
380span.green { color: green; }
381span.lime { color: lime; }
382span.maroon { color: maroon; }
383span.navy { color: navy; }
384span.olive { color: olive; }
385span.purple { color: purple; }
386span.red { color: red; }
387span.silver { color: silver; }
388span.teal { color: teal; }
389span.white { color: white; }
390span.yellow { color: yellow; }
391
392span.aqua-background { background: aqua; }
393span.black-background { background: black; }
394span.blue-background { background: blue; }
395span.fuchsia-background { background: fuchsia; }
396span.gray-background { background: gray; }
397span.green-background { background: green; }
398span.lime-background { background: lime; }
399span.maroon-background { background: maroon; }
400span.navy-background { background: navy; }
401span.olive-background { background: olive; }
402span.purple-background { background: purple; }
403span.red-background { background: red; }
404span.silver-background { background: silver; }
405span.teal-background { background: teal; }
406span.white-background { background: white; }
407span.yellow-background { background: yellow; }
408
409span.big { font-size: 2em; }
410span.small { font-size: 0.6em; }
411
412span.underline { text-decoration: underline; }
413span.overline { text-decoration: overline; }
414span.line-through { text-decoration: line-through; }
415
Junio C Hamanoc14e6ad2014-10-31 20:25:53416div.unbreakable { page-break-inside: avoid; }
417
Junio C Hamano9d971152012-12-19 00:43:11418
419/*
420 * xhtml11 specific
421 *
422 * */
423
424div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427}
428div.tableblock > table {
429 border: 3px solid #527bbd;
430}
431thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434}
435p.table {
436 margin-top: 0;
437}
438/* Because the table frame attribute is overriden by CSS in most browsers. */
439div.tableblock > table[frame="void"] {
440 border-style: none;
441}
442div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445}
446div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449}
450
451
452/*
453 * html5 specific
454 *
455 * */
456
457table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460}
461thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464}
465p.tableblock {
466 margin-top: 0;
467}
468table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474}
475th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480}
481
482table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485}
486table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489}
490table.tableblock.frame-none {
491 border-style: hidden;
492}
493
494th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496}
497th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499}
500th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502}
503
504th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506}
507th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509}
510th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512}
513
514
515/*
516 * manpage specific
517 *
518 * */
519
520body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525}
Junio C Hamano9d971152012-12-19 00:43:11526body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59527 border-style: none;
528}
Junio C Hamano9d971152012-12-19 00:43:11529body.manpage div.sectionbody {
530 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59531}
532
533@media print {
Junio C Hamano9d971152012-12-19 00:43:11534 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59535}
Junio C Hamanoc14e6ad2014-10-31 20:25:53536
537
Junio C Hamanodf60f442007-02-07 05:52:37538</style>
Junio C Hamano7bd050f2011-09-22 06:32:22539<script type="text/javascript">
540/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22541var asciidoc = { // Namespace.
542
543/////////////////////////////////////////////////////////////////////
544// Table Of Contents generator
545/////////////////////////////////////////////////////////////////////
546
547/* Author: Mihai Bazon, September 2002
548 * http://students.infoiasi.ro/~mishoo
549 *
550 * Table Of Content generator
551 * Version: 0.4
552 *
553 * Feel free to use this script under the terms of the GNU General Public
554 * License, as long as you do not remove or alter this notice.
555 */
556
557 /* modified by Troy D. Hanson, September 2006. License: GPL */
558 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
559
560// toclevels = 1..4.
561toc: function (toclevels) {
562
563 function getText(el) {
564 var text = "";
565 for (var i = el.firstChild; i != null; i = i.nextSibling) {
566 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
567 text += i.data;
568 else if (i.firstChild != null)
569 text += getText(i);
570 }
571 return text;
572 }
573
574 function TocEntry(el, text, toclevel) {
575 this.element = el;
576 this.text = text;
577 this.toclevel = toclevel;
578 }
579
580 function tocEntries(el, toclevels) {
581 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53582 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22583 // Function that scans the DOM tree for header elements (the DOM2
584 // nodeIterator API would be a better technique but not supported by all
585 // browsers).
586 var iterate = function (el) {
587 for (var i = el.firstChild; i != null; i = i.nextSibling) {
588 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
589 var mo = re.exec(i.tagName);
590 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
591 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
592 }
593 iterate(i);
594 }
595 }
596 }
597 iterate(el);
598 return result;
599 }
600
601 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11602 if (!toc) {
603 return;
604 }
605
606 // Delete existing TOC entries in case we're reloading the TOC.
607 var tocEntriesToRemove = [];
608 var i;
609 for (i = 0; i < toc.childNodes.length; i++) {
610 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53611 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11612 && entry.getAttribute("class")
613 && entry.getAttribute("class").match(/^toclevel/))
614 tocEntriesToRemove.push(entry);
615 }
616 for (i = 0; i < tocEntriesToRemove.length; i++) {
617 toc.removeChild(tocEntriesToRemove[i]);
618 }
619
620 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22621 var entries = tocEntries(document.getElementById("content"), toclevels);
622 for (var i = 0; i < entries.length; ++i) {
623 var entry = entries[i];
624 if (entry.element.id == "")
625 entry.element.id = "_toc_" + i;
626 var a = document.createElement("a");
627 a.href = "#" + entry.element.id;
628 a.appendChild(document.createTextNode(entry.text));
629 var div = document.createElement("div");
630 div.appendChild(a);
631 div.className = "toclevel" + entry.toclevel;
632 toc.appendChild(div);
633 }
634 if (entries.length == 0)
635 toc.parentNode.removeChild(toc);
636},
637
638
639/////////////////////////////////////////////////////////////////////
640// Footnotes generator
641/////////////////////////////////////////////////////////////////////
642
643/* Based on footnote generation code from:
644 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
645 */
646
647footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11648 // Delete existing footnote entries in case we're reloading the footnodes.
649 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22650 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11651 if (!noteholder) {
652 return;
653 }
654 var entriesToRemove = [];
655 for (i = 0; i < noteholder.childNodes.length; i++) {
656 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53657 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11658 entriesToRemove.push(entry);
659 }
660 for (i = 0; i < entriesToRemove.length; i++) {
661 noteholder.removeChild(entriesToRemove[i]);
662 }
663
664 // Rebuild footnote entries.
665 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22666 var spans = cont.getElementsByTagName("span");
667 var refs = {};
668 var n = 0;
669 for (i=0; i<spans.length; i++) {
670 if (spans[i].className == "footnote") {
671 n++;
Junio C Hamano9d971152012-12-19 00:43:11672 var note = spans[i].getAttribute("data-note");
673 if (!note) {
674 // Use [\s\S] in place of . so multi-line matches work.
675 // Because JavaScript has no s (dotall) regex flag.
676 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
677 spans[i].innerHTML =
678 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
679 "' title='View footnote' class='footnote'>" + n + "</a>]";
680 spans[i].setAttribute("data-note", note);
681 }
Junio C Hamano7bd050f2011-09-22 06:32:22682 noteholder.innerHTML +=
683 "<div class='footnote' id='_footnote_" + n + "'>" +
684 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
685 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22686 var id =spans[i].getAttribute("id");
687 if (id != null) refs["#"+id] = n;
688 }
689 }
690 if (n == 0)
691 noteholder.parentNode.removeChild(noteholder);
692 else {
693 // Process footnoterefs.
694 for (i=0; i<spans.length; i++) {
695 if (spans[i].className == "footnoteref") {
696 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
697 href = href.match(/#.*/)[0]; // Because IE return full URL.
698 n = refs[href];
699 spans[i].innerHTML =
700 "[<a href='#_footnote_" + n +
701 "' title='View footnote' class='footnote'>" + n + "</a>]";
702 }
703 }
704 }
Junio C Hamano9d971152012-12-19 00:43:11705},
706
707install: function(toclevels) {
708 var timerId;
709
710 function reinstall() {
711 asciidoc.footnotes();
712 if (toclevels) {
713 asciidoc.toc(toclevels);
714 }
715 }
716
717 function reinstallAndRemoveTimer() {
718 clearInterval(timerId);
719 reinstall();
720 }
721
722 timerId = setInterval(reinstall, 500);
723 if (document.addEventListener)
724 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
725 else
726 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22727}
728
729}
Junio C Hamano9d971152012-12-19 00:43:11730asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22731/*]]>*/
732</script>
Junio C Hamanodf60f442007-02-07 05:52:37733</head>
Junio C Hamano9d971152012-12-19 00:43:11734<body class="manpage">
Junio C Hamanodf60f442007-02-07 05:52:37735<div id="header">
736<h1>
737git-fast-import(1) Manual Page
738</h1>
739<h2>NAME</h2>
740<div class="sectionbody">
741<p>git-fast-import -
Junio C Hamano053827f2007-02-14 07:23:58742 Backend for fast Git data importers
Junio C Hamanodf60f442007-02-07 05:52:37743</p>
744</div>
745</div>
Junio C Hamano7bd050f2011-09-22 06:32:22746<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11747<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59748<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamanodf60f442007-02-07 05:52:37749<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59750<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11751<pre class="content">frontend | <em>git fast-import</em> [options]</pre>
752<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59753</div></div>
Junio C Hamanodf60f442007-02-07 05:52:37754</div>
Junio C Hamano9d971152012-12-19 00:43:11755</div>
756<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31757<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanodf60f442007-02-07 05:52:37758<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59759<div class="paragraph"><p>This program is usually not what the end user wants to run directly.
Junio C Hamanodf60f442007-02-07 05:52:37760Most end users want to use one of the existing frontend programs,
761which parses a specific type of foreign source and feeds the contents
Junio C Hamano1aa40d22010-01-21 17:46:43762stored there to <em>git fast-import</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59763<div class="paragraph"><p>fast-import reads a mixed command/data stream from standard input and
Junio C Hamanodf60f442007-02-07 05:52:37764writes one or more packfiles directly into the current repository.
765When EOF is received on standard input, fast import writes out
766updated branch and tag refs, fully updating the current repository
Junio C Hamanoba4b9282008-07-06 05:20:31767with the newly imported data.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59768<div class="paragraph"><p>The fast-import backend itself can import into an empty repository (one that
Junio C Hamano1aa40d22010-01-21 17:46:43769has already been initialized by <em>git init</em>) or incrementally
Junio C Hamanodf60f442007-02-07 05:52:37770update an existing populated repository. Whether or not incremental
771imports are supported from a particular foreign source depends on
Junio C Hamanoba4b9282008-07-06 05:20:31772the frontend program in use.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:37773</div>
Junio C Hamano9d971152012-12-19 00:43:11774</div>
775<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31776<h2 id="_options">OPTIONS</h2>
Junio C Hamanodf60f442007-02-07 05:52:37777<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59778<div class="dlist"><dl>
779<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31780--force
781</dt>
782<dd>
783<p>
784 Force updating modified existing branches, even if doing
785 so would cause commits to be lost (as the new commit does
786 not contain the old commit).
787</p>
788</dd>
789<dt class="hdlist1">
790--quiet
791</dt>
792<dd>
793<p>
794 Disable all non-fatal output, making fast-import silent when it
795 is successful. This option disables the output shown by
796 --stats.
797</p>
798</dd>
799<dt class="hdlist1">
800--stats
801</dt>
802<dd>
803<p>
804 Display some basic statistics about the objects fast-import has
805 created, the packfiles they were stored into, and the
806 memory used by fast-import during this run. Showing this output
807 is currently the default, but can be disabled with --quiet.
808</p>
809</dd>
810</dl></div>
811<div class="sect2">
812<h3 id="_options_for_frontends">Options for Frontends</h3>
813<div class="dlist"><dl>
814<dt class="hdlist1">
815--cat-blob-fd=&lt;fd&gt;
816</dt>
817<dd>
818<p>
Junio C Hamanod7ed4042015-08-03 19:43:00819 Write responses to <code>get-mark</code>, <code>cat-blob</code>, and <code>ls</code> queries to the
Junio C Hamanoc14e6ad2014-10-31 20:25:53820 file descriptor &lt;fd&gt; instead of <code>stdout</code>. Allows <code>progress</code>
Junio C Hamano7dac6902013-01-12 08:25:31821 output intended for the end-user to be separated from other
822 output.
823</p>
824</dd>
825<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:37826--date-format=&lt;fmt&gt;
827</dt>
828<dd>
829<p>
830 Specify the type of dates the frontend will supply to
Junio C Hamanoc14e6ad2014-10-31 20:25:53831 fast-import within <code>author</code>, <code>committer</code> and <code>tagger</code> commands.
Junio C Hamanodf60f442007-02-07 05:52:37832 See &#8220;Date Formats&#8221; below for details about which formats
833 are supported, and their syntax.
834</p>
835</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59836<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31837--done
Junio C Hamanodf60f442007-02-07 05:52:37838</dt>
839<dd>
840<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53841 Terminate with error if there is no <code>done</code> command at the end of
Junio C Hamano7dac6902013-01-12 08:25:31842 the stream. This option might be useful for detecting errors
843 that cause the frontend to terminate before it has started to
844 write a stream.
Junio C Hamanodf60f442007-02-07 05:52:37845</p>
846</dd>
Junio C Hamano7dac6902013-01-12 08:25:31847</dl></div>
848</div>
849<div class="sect2">
850<h3 id="_locations_of_marks_files">Locations of Marks Files</h3>
851<div class="dlist"><dl>
Junio C Hamano68cf15a2010-11-06 01:01:59852<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:37853--export-marks=&lt;file&gt;
854</dt>
855<dd>
856<p>
857 Dumps the internal marks table to &lt;file&gt; when complete.
Junio C Hamanoc14e6ad2014-10-31 20:25:53858 Marks are written one per line as <code>:markid SHA-1</code>.
Junio C Hamanodf60f442007-02-07 05:52:37859 Frontends can use this file to validate imports after they
Junio C Hamanod15328a2007-03-09 09:06:40860 have been completed, or to save the marks table across
861 incremental runs. As &lt;file&gt; is only opened and truncated
862 at checkpoint (or completion) the same path can also be
863 safely given to --import-marks.
864</p>
865</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59866<dt class="hdlist1">
Junio C Hamanod15328a2007-03-09 09:06:40867--import-marks=&lt;file&gt;
868</dt>
869<dd>
870<p>
871 Before processing any input, load the marks specified in
872 &lt;file&gt;. The input file must exist, must be readable, and
873 must use the same format as produced by --export-marks.
874 Multiple options may be supplied to import more than one
875 set of marks. If a mark is defined to different values,
876 the last file wins.
Junio C Hamanodf60f442007-02-07 05:52:37877</p>
878</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59879<dt class="hdlist1">
Junio C Hamano23e3f532011-02-10 02:05:29880--import-marks-if-exists=&lt;file&gt;
881</dt>
882<dd>
883<p>
884 Like --import-marks but instead of erroring out, silently
885 skips the file if it does not exist.
886</p>
887</dd>
888<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31889--[no-]relative-marks
Junio C Hamano6ce6b6c2010-01-18 01:25:50890</dt>
891<dd>
892<p>
Junio C Hamanoa0dac242011-05-06 05:10:29893 After specifying --relative-marks the paths specified
Junio C Hamano6ce6b6c2010-01-18 01:25:50894 with --import-marks= and --export-marks= are relative
895 to an internal directory in the current repository.
896 In git-fast-import this means that the paths are relative
897 to the .git/info/fast-import directory. However, other
898 importers may use a different location.
899</p>
Junio C Hamano7dac6902013-01-12 08:25:31900<div class="paragraph"><p>Relative and non-relative marks may be combined by interweaving
901--(no-)-relative-marks with the --(import|export)-marks= options.</p></div>
Junio C Hamano6ce6b6c2010-01-18 01:25:50902</dd>
Junio C Hamano7dac6902013-01-12 08:25:31903</dl></div>
904</div>
905<div class="sect2">
906<h3 id="_performance_and_compression_tuning">Performance and Compression Tuning</h3>
907<div class="dlist"><dl>
Junio C Hamano68cf15a2010-11-06 01:01:59908<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31909--active-branches=&lt;n&gt;
Junio C Hamano6ce6b6c2010-01-18 01:25:50910</dt>
911<dd>
912<p>
Junio C Hamano7dac6902013-01-12 08:25:31913 Maximum number of branches to maintain active at once.
914 See &#8220;Memory Utilization&#8221; below for details. Default is 5.
Junio C Hamano6ce6b6c2010-01-18 01:25:50915</p>
916</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59917<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31918--big-file-threshold=&lt;n&gt;
Junio C Hamano0d75e872010-12-17 06:57:26919</dt>
920<dd>
921<p>
Junio C Hamano7dac6902013-01-12 08:25:31922 Maximum size of a blob that fast-import will attempt to
923 create a delta for, expressed in bytes. The default is 512m
924 (512 MiB). Some importers may wish to lower this on systems
925 with constrained memory.
Junio C Hamano0d75e872010-12-17 06:57:26926</p>
927</dd>
928<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31929--depth=&lt;n&gt;
Junio C Hamanofbc773c2011-08-02 00:09:12930</dt>
931<dd>
932<p>
Junio C Hamano7dac6902013-01-12 08:25:31933 Maximum delta depth, for blob and tree deltification.
Junio C Hamano55d91912017-06-22 22:32:46934 Default is 50.
Junio C Hamanofbc773c2011-08-02 00:09:12935</p>
936</dd>
937<dt class="hdlist1">
Junio C Hamano9dd8bb02007-02-12 07:15:35938--export-pack-edges=&lt;file&gt;
939</dt>
940<dd>
941<p>
942 After creating a packfile, print a line of data to
943 &lt;file&gt; listing the filename of the packfile and the last
944 commit on each branch that was written to that packfile.
945 This information may be useful after importing projects
946 whose total object set exceeds the 4 GiB packfile limit,
947 as these commits can be used as edge points during calls
Junio C Hamano1aa40d22010-01-21 17:46:43948 to <em>git pack-objects</em>.
Junio C Hamano9dd8bb02007-02-12 07:15:35949</p>
950</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59951<dt class="hdlist1">
Junio C Hamano7dac6902013-01-12 08:25:31952--max-pack-size=&lt;n&gt;
Junio C Hamanodfc4ce72007-02-07 23:17:29953</dt>
954<dd>
955<p>
Junio C Hamano7dac6902013-01-12 08:25:31956 Maximum size of each output packfile.
957 The default is unlimited.
Junio C Hamanodfc4ce72007-02-07 23:17:29958</p>
959</dd>
Junio C Hamanofedb1b42016-06-20 21:23:40960<dt class="hdlist1">
961fastimport.unpackLimit
962</dt>
963<dd>
964<p>
965 See <a href="git-config.html">git-config(1)</a>
966</p>
967</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31968</dl></div>
Junio C Hamanodf60f442007-02-07 05:52:37969</div>
Junio C Hamano9d971152012-12-19 00:43:11970</div>
Junio C Hamano7dac6902013-01-12 08:25:31971</div>
Junio C Hamano9d971152012-12-19 00:43:11972<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31973<h2 id="_performance">Performance</h2>
Junio C Hamanodf60f442007-02-07 05:52:37974<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59975<div class="paragraph"><p>The design of fast-import allows it to import large projects in a minimum
Junio C Hamanodf60f442007-02-07 05:52:37976amount of memory usage and processing time. Assuming the frontend
Junio C Hamanod3339982007-02-09 08:38:48977is able to keep up with fast-import and feed it a constant stream of data,
Junio C Hamanodf60f442007-02-07 05:52:37978import times for projects holding 10+ years of history and containing
979100,000+ individual commits are generally completed in just 1-2
Junio C Hamanoba4b9282008-07-06 05:20:31980hours on quite modest (~$2,000 USD) hardware.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59981<div class="paragraph"><p>Most bottlenecks appear to be in foreign source data access (the
Junio C Hamanod3339982007-02-09 08:38:48982source just cannot extract revisions fast enough) or disk IO (fast-import
Junio C Hamanodf60f442007-02-07 05:52:37983writes as fast as the disk will take the data). Imports will run
984faster if the source data is stored on a different drive than the
Junio C Hamanoba4b9282008-07-06 05:20:31985destination Git repository (due to less IO contention).</p></div>
Junio C Hamanodf60f442007-02-07 05:52:37986</div>
Junio C Hamano9d971152012-12-19 00:43:11987</div>
988<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31989<h2 id="_development_cost">Development Cost</h2>
Junio C Hamanodf60f442007-02-07 05:52:37990<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:59991<div class="paragraph"><p>A typical frontend for fast-import tends to weigh in at approximately 200
Junio C Hamanodf60f442007-02-07 05:52:37992lines of Perl/Python/Ruby code. Most developers have been able to
993create working importers in just a couple of hours, even though it
Junio C Hamanod3339982007-02-09 08:38:48994is their first exposure to fast-import, and sometimes even to Git. This is
Junio C Hamanodf60f442007-02-07 05:52:37995an ideal situation, given that most conversion tools are throw-away
Junio C Hamanoba4b9282008-07-06 05:20:31996(use once, and never look back).</p></div>
Junio C Hamanodf60f442007-02-07 05:52:37997</div>
Junio C Hamano9d971152012-12-19 00:43:11998</div>
999<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311000<h2 id="_parallel_operation">Parallel Operation</h2>
Junio C Hamanodf60f442007-02-07 05:52:371001<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591002<div class="paragraph"><p>Like <em>git push</em> or <em>git fetch</em>, imports handled by fast-import are safe to
Junio C Hamanoc14e6ad2014-10-31 20:25:531003run alongside parallel <code>git repack -a -d</code> or <code>git gc</code> invocations,
Junio C Hamano1aa40d22010-01-21 17:46:431004or any other Git operation (including <em>git prune</em>, as loose objects
Junio C Hamanoba4b9282008-07-06 05:20:311005are never used by fast-import).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591006<div class="paragraph"><p>fast-import does not lock the branch or tag refs it is actively importing.
Junio C Hamanod3339982007-02-09 08:38:481007After the import, during its ref update phase, fast-import tests each
Junio C Hamanodf60f442007-02-07 05:52:371008existing branch ref to verify the update will be a fast-forward
1009update (the commit stored in the ref is contained in the new
1010history of the commit to be written). If the update is not a
Junio C Hamanod3339982007-02-09 08:38:481011fast-forward update, fast-import will skip updating that ref and instead
1012prints a warning message. fast-import will always attempt to update all
Junio C Hamanoba4b9282008-07-06 05:20:311013branch refs, and does not stop on the first failure.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591014<div class="paragraph"><p>Branch updates can be forced with --force, but it&#8217;s recommended that
Junio C Hamanodfc4ce72007-02-07 23:17:291015this only be used on an otherwise quiet repository. Using --force
Junio C Hamanoba4b9282008-07-06 05:20:311016is not necessary for an initial import into an empty repository.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371017</div>
Junio C Hamano9d971152012-12-19 00:43:111018</div>
1019<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311020<h2 id="_technical_discussion">Technical Discussion</h2>
Junio C Hamanodf60f442007-02-07 05:52:371021<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591022<div class="paragraph"><p>fast-import tracks a set of branches in memory. Any branch can be created
Junio C Hamanodf60f442007-02-07 05:52:371023or modified at any point during the import process by sending a
Junio C Hamanoc14e6ad2014-10-31 20:25:531024<code>commit</code> command on the input stream. This design allows a frontend
Junio C Hamanodf60f442007-02-07 05:52:371025program to process an unlimited number of branches simultaneously,
1026generating commits in the order they are available from the source
Junio C Hamanoba4b9282008-07-06 05:20:311027data. It also simplifies the frontend programs considerably.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591028<div class="paragraph"><p>fast-import does not use or alter the current working directory, or any
Junio C Hamanodf60f442007-02-07 05:52:371029file within it. (It does however update the current Git repository,
Junio C Hamanoc14e6ad2014-10-31 20:25:531030as referenced by <code>GIT_DIR</code>.) Therefore an import frontend may use
Junio C Hamanodf60f442007-02-07 05:52:371031the working directory for its own purposes, such as extracting file
1032revisions from the foreign source. This ignorance of the working
Junio C Hamanod3339982007-02-09 08:38:481033directory also allows fast-import to run very quickly, as it does not
Junio C Hamanodf60f442007-02-07 05:52:371034need to perform any costly file update operations when switching
Junio C Hamanoba4b9282008-07-06 05:20:311035between branches.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371036</div>
Junio C Hamano9d971152012-12-19 00:43:111037</div>
1038<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311039<h2 id="_input_format">Input Format</h2>
Junio C Hamanodf60f442007-02-07 05:52:371040<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591041<div class="paragraph"><p>With the exception of raw file data (which Git does not interpret)
Junio C Hamanod3339982007-02-09 08:38:481042the fast-import input format is text (ASCII) based. This text based
Junio C Hamanodf60f442007-02-07 05:52:371043format simplifies development and debugging of frontend programs,
1044especially when a higher level language such as Perl, Python or
Junio C Hamanoba4b9282008-07-06 05:20:311045Ruby is being used.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591046<div class="paragraph"><p>fast-import is very strict about its input. Where we say SP below we mean
Junio C Hamano73d10512011-03-01 01:02:381047<strong>exactly</strong> one space. Likewise LF means one (and only one) linefeed
1048and HT one (and only one) horizontal tab.
Junio C Hamanodf60f442007-02-07 05:52:371049Supplying additional whitespace characters will cause unexpected
1050results, such as branch names or file names with leading or trailing
Junio C Hamanod3339982007-02-09 08:38:481051spaces in their name, or early termination of fast-import when it encounters
Junio C Hamanoba4b9282008-07-06 05:20:311052unexpected input.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111053<div class="sect2">
1054<h3 id="_stream_comments">Stream Comments</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591055<div class="paragraph"><p>To aid in debugging frontends fast-import ignores any line that
Junio C Hamanoc14e6ad2014-10-31 20:25:531056begins with <code>#</code> (ASCII pound/hash) up to and including the line
1057ending <code>LF</code>. A comment line may contain any sequence of bytes
Junio C Hamanoe52cf782007-08-19 19:15:521058that does not contain an LF and therefore may be used to include
1059any detailed debugging information that might be specific to the
Junio C Hamanoba4b9282008-07-06 05:20:311060frontend and useful when inspecting a fast-import data stream.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111061</div>
1062<div class="sect2">
1063<h3 id="_date_formats">Date Formats</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591064<div class="paragraph"><p>The following date formats are supported. A frontend should select
Junio C Hamanodf60f442007-02-07 05:52:371065the format it will use for this import by passing the format name
Junio C Hamanoe1aeb5e2014-06-06 19:16:291066in the --date-format=&lt;fmt&gt; command-line option.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591067<div class="dlist"><dl>
1068<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531069<code>raw</code>
Junio C Hamanodf60f442007-02-07 05:52:371070</dt>
1071<dd>
1072<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531073 This is the Git native format and is <code>&lt;time&gt; SP &lt;offutc&gt;</code>.
Junio C Hamano68cf15a2010-11-06 01:01:591074 It is also fast-import&#8217;s default format, if --date-format was
Junio C Hamanodf60f442007-02-07 05:52:371075 not specified.
1076</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531077<div class="paragraph"><p>The time of the event is specified by <code>&lt;time&gt;</code> as the number of
Junio C Hamanodf60f442007-02-07 05:52:371078seconds since the UNIX epoch (midnight, Jan 1, 1970, UTC) and is
Junio C Hamanoba4b9282008-07-06 05:20:311079written as an ASCII decimal integer.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531080<div class="paragraph"><p>The local offset is specified by <code>&lt;offutc&gt;</code> as a positive or negative
Junio C Hamanodfc4ce72007-02-07 23:17:291081offset from UTC. For example EST (which is 5 hours behind UTC)
Junio C Hamanoc14e6ad2014-10-31 20:25:531082would be expressed in <code>&lt;tz&gt;</code> by &#8220;-0500&#8221; while UTC is &#8220;+0000&#8221;.
1083The local offset does not affect <code>&lt;time&gt;</code>; it is used only as an
Junio C Hamanoba4b9282008-07-06 05:20:311084advisement to help formatting routines display the timestamp.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591085<div class="paragraph"><p>If the local offset is not available in the source material, use
Junio C Hamanodfc4ce72007-02-07 23:17:291086&#8220;+0000&#8221;, or the most common local offset. For example many
Junio C Hamanodf60f442007-02-07 05:52:371087organizations have a CVS repository which has only ever been accessed
Junio C Hamanoe3acfb82013-11-12 23:22:571088by users who are located in the same location and time zone. In this
Junio C Hamanoba4b9282008-07-06 05:20:311089case a reasonable offset from UTC could be assumed.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531090<div class="paragraph"><p>Unlike the <code>rfc2822</code> format, this format is very strict. Any
Junio C Hamanoba4b9282008-07-06 05:20:311091variation in formatting will cause fast-import to reject the value.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371092</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591093<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531094<code>rfc2822</code>
Junio C Hamanodf60f442007-02-07 05:52:371095</dt>
1096<dd>
1097<p>
1098 This is the standard email format as described by RFC 2822.
1099</p>
Junio C Hamano68cf15a2010-11-06 01:01:591100<div class="paragraph"><p>An example value is &#8220;Tue Feb 6 11:22:18 2007 -0500&#8221;. The Git
Junio C Hamanod3339982007-02-09 08:38:481101parser is accurate, but a little on the lenient side. It is the
Junio C Hamano1aa40d22010-01-21 17:46:431102same parser used by <em>git am</em> when applying patches
Junio C Hamanoba4b9282008-07-06 05:20:311103received from email.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591104<div class="paragraph"><p>Some malformed strings may be accepted as valid dates. In some of
Junio C Hamanodf60f442007-02-07 05:52:371105these cases Git will still be able to obtain the correct date from
1106the malformed string. There are also some types of malformed
1107strings which Git will parse wrong, and yet consider valid.
Junio C Hamanoba4b9282008-07-06 05:20:311108Seriously malformed strings will be rejected.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531109<div class="paragraph"><p>Unlike the <code>raw</code> format above, the time zone/UTC offset information
Junio C Hamanodfc4ce72007-02-07 23:17:291110contained in an RFC 2822 date string is used to adjust the date
1111value to UTC prior to storage. Therefore it is important that
Junio C Hamanoba4b9282008-07-06 05:20:311112this information be as accurate as possible.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591113<div class="paragraph"><p>If the source material uses RFC 2822 style dates,
Junio C Hamanod3339982007-02-09 08:38:481114the frontend should let fast-import handle the parsing and conversion
Junio C Hamanodf60f442007-02-07 05:52:371115(rather than attempting to do it itself) as the Git parser has
Junio C Hamanoba4b9282008-07-06 05:20:311116been well tested in the wild.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531117<div class="paragraph"><p>Frontends should prefer the <code>raw</code> format if the source material
Junio C Hamanod3339982007-02-09 08:38:481118already uses UNIX-epoch format, can be coaxed to give dates in that
Junio C Hamanoa6387422007-08-25 03:54:271119format, or its format is easily convertible to it, as there is no
Junio C Hamanoba4b9282008-07-06 05:20:311120ambiguity in parsing.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371121</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591122<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531123<code>now</code>
Junio C Hamanodf60f442007-02-07 05:52:371124</dt>
1125<dd>
1126<p>
Junio C Hamanoe3acfb82013-11-12 23:22:571127 Always use the current time and time zone. The literal
Junio C Hamanoc14e6ad2014-10-31 20:25:531128 <code>now</code> must always be supplied for <code>&lt;when&gt;</code>.
Junio C Hamanodf60f442007-02-07 05:52:371129</p>
Junio C Hamanoe3acfb82013-11-12 23:22:571130<div class="paragraph"><p>This is a toy format. The current time and time zone of this system
Junio C Hamanodf60f442007-02-07 05:52:371131is always copied into the identity string at the time it is being
Junio C Hamanod3339982007-02-09 08:38:481132created by fast-import. There is no way to specify a different time or
Junio C Hamanoe3acfb82013-11-12 23:22:571133time zone.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591134<div class="paragraph"><p>This particular format is supplied as it&#8217;s short to implement and
Junio C Hamanodf60f442007-02-07 05:52:371135may be useful to a process that wants to create a new commit
1136right now, without needing to use a working directory or
Junio C Hamano1aa40d22010-01-21 17:46:431137<em>git update-index</em>.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531138<div class="paragraph"><p>If separate <code>author</code> and <code>committer</code> commands are used in a <code>commit</code>
Junio C Hamanodf60f442007-02-07 05:52:371139the timestamps may not match, as the system clock will be polled
1140twice (once for each command). The only way to ensure that both
1141author and committer identity information has the same timestamp
Junio C Hamanoc14e6ad2014-10-31 20:25:531142is to omit <code>author</code> (thus copying from <code>committer</code>) or to use a
1143date format other than <code>now</code>.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371144</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311145</dl></div>
Junio C Hamano9d971152012-12-19 00:43:111146</div>
1147<div class="sect2">
1148<h3 id="_commands">Commands</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591149<div class="paragraph"><p>fast-import accepts several commands to update the current repository
Junio C Hamanodf60f442007-02-07 05:52:371150and control the current import process. More detailed discussion
Junio C Hamanoba4b9282008-07-06 05:20:311151(with examples) of each command follows later.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591152<div class="dlist"><dl>
1153<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531154<code>commit</code>
Junio C Hamanodf60f442007-02-07 05:52:371155</dt>
1156<dd>
1157<p>
1158 Creates a new branch or updates an existing branch by
1159 creating a new commit and updating the branch to point at
1160 the newly created commit.
1161</p>
1162</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591163<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531164<code>tag</code>
Junio C Hamanodf60f442007-02-07 05:52:371165</dt>
1166<dd>
1167<p>
1168 Creates an annotated tag object from an existing commit or
1169 branch. Lightweight tags are not supported by this command,
1170 as they are not recommended for recording meaningful points
1171 in time.
1172</p>
1173</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591174<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531175<code>reset</code>
Junio C Hamanodf60f442007-02-07 05:52:371176</dt>
1177<dd>
1178<p>
1179 Reset an existing branch (or a new branch) to a specific
1180 revision. This command must be used to change a branch to
1181 a specific revision without making a commit on it.
1182</p>
1183</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591184<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531185<code>blob</code>
Junio C Hamanodf60f442007-02-07 05:52:371186</dt>
1187<dd>
1188<p>
1189 Convert raw file data into a blob, for future use in a
Junio C Hamanoc14e6ad2014-10-31 20:25:531190 <code>commit</code> command. This command is optional and is not
Junio C Hamanodf60f442007-02-07 05:52:371191 needed to perform an import.
1192</p>
1193</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591194<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531195<code>checkpoint</code>
Junio C Hamanodf60f442007-02-07 05:52:371196</dt>
1197<dd>
1198<p>
Junio C Hamanod3339982007-02-09 08:38:481199 Forces fast-import to close the current packfile, generate its
Junio C Hamanodf60f442007-02-07 05:52:371200 unique SHA-1 checksum and index, and start a new packfile.
1201 This command is optional and is not needed to perform
1202 an import.
1203</p>
1204</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591205<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531206<code>progress</code>
Junio C Hamanoe52cf782007-08-19 19:15:521207</dt>
1208<dd>
1209<p>
1210 Causes fast-import to echo the entire line to its own
1211 standard output. This command is optional and is not needed
1212 to perform an import.
1213</p>
1214</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591215<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531216<code>done</code>
Junio C Hamanofbc773c2011-08-02 00:09:121217</dt>
1218<dd>
1219<p>
1220 Marks the end of the stream. This command is optional
Junio C Hamanoc14e6ad2014-10-31 20:25:531221 unless the <code>done</code> feature was requested using the
1222 <code>--done</code> command-line option or <code>feature done</code> command.
Junio C Hamanofbc773c2011-08-02 00:09:121223</p>
1224</dd>
1225<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:001226<code>get-mark</code>
1227</dt>
1228<dd>
1229<p>
1230 Causes fast-import to print the SHA-1 corresponding to a mark
1231 to the file descriptor set with <code>--cat-blob-fd</code>, or <code>stdout</code> if
1232 unspecified.
1233</p>
1234</dd>
1235<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531236<code>cat-blob</code>
Junio C Hamano0d75e872010-12-17 06:57:261237</dt>
1238<dd>
1239<p>
1240 Causes fast-import to print a blob in <em>cat-file --batch</em>
Junio C Hamanoc14e6ad2014-10-31 20:25:531241 format to the file descriptor set with <code>--cat-blob-fd</code> or
1242 <code>stdout</code> if unspecified.
Junio C Hamano0d75e872010-12-17 06:57:261243</p>
1244</dd>
1245<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531246<code>ls</code>
Junio C Hamano73d10512011-03-01 01:02:381247</dt>
1248<dd>
1249<p>
1250 Causes fast-import to print a line describing a directory
1251 entry in <em>ls-tree</em> format to the file descriptor set with
Junio C Hamanoc14e6ad2014-10-31 20:25:531252 <code>--cat-blob-fd</code> or <code>stdout</code> if unspecified.
Junio C Hamano73d10512011-03-01 01:02:381253</p>
1254</dd>
1255<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531256<code>feature</code>
Junio C Hamano6ce6b6c2010-01-18 01:25:501257</dt>
1258<dd>
1259<p>
Junio C Hamano0e0e0d22013-09-12 23:25:031260 Enable the specified feature. This requires that fast-import
1261 supports the specified feature, and aborts if it does not.
Junio C Hamano6ce6b6c2010-01-18 01:25:501262</p>
1263</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591264<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531265<code>option</code>
Junio C Hamano6ce6b6c2010-01-18 01:25:501266</dt>
1267<dd>
1268<p>
1269 Specify any of the options listed under OPTIONS that do not
Junio C Hamano68cf15a2010-11-06 01:01:591270 change stream semantic to suit the frontend&#8217;s needs. This
Junio C Hamano6ce6b6c2010-01-18 01:25:501271 command is optional and is not needed to perform an import.
1272</p>
1273</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311274</dl></div>
Junio C Hamano9d971152012-12-19 00:43:111275</div>
1276<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531277<h3 id="_code_commit_code"><code>commit</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591278<div class="paragraph"><p>Create or update a branch with a new commit, recording one logical
Junio C Hamanoba4b9282008-07-06 05:20:311279change to the project.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371280<div class="literalblock">
1281<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531282<pre><code> 'commit' SP &lt;ref&gt; LF
Junio C Hamanodf60f442007-02-07 05:52:371283 mark?
Junio C Hamano6d325df2010-01-01 00:02:471284 ('author' (SP &lt;name&gt;)? SP LT &lt;email&gt; GT SP &lt;when&gt; LF)?
1285 'committer' (SP &lt;name&gt;)? SP LT &lt;email&gt; GT SP &lt;when&gt; LF
Junio C Hamanodf60f442007-02-07 05:52:371286 data
Junio C Hamanoe6f28d02013-09-17 21:34:001287 ('from' SP &lt;commit-ish&gt; LF)?
1288 ('merge' SP &lt;commit-ish&gt; LF)?
Junio C Hamano3b70d3c2009-11-21 17:37:371289 (filemodify | filedelete | filecopy | filerename | filedeleteall | notemodify)*
Junio C Hamanoc14e6ad2014-10-31 20:25:531290 LF?</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371291</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531292<div class="paragraph"><p>where <code>&lt;ref&gt;</code> is the name of the branch to make the commit on.
1293Typically branch names are prefixed with <code>refs/heads/</code> in
1294Git, so importing the CVS branch symbol <code>RELENG-1_0</code> would use
1295<code>refs/heads/RELENG-1_0</code> for the value of <code>&lt;ref&gt;</code>. The value of
1296<code>&lt;ref&gt;</code> must be a valid refname in Git. As <code>LF</code> is not valid in
Junio C Hamanoba4b9282008-07-06 05:20:311297a Git refname, no quoting or escaping syntax is supported here.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531298<div class="paragraph"><p>A <code>mark</code> command may optionally appear, requesting fast-import to save a
Junio C Hamanodf60f442007-02-07 05:52:371299reference to the newly created commit for future use by the frontend
1300(see below for format). It is very common for frontends to mark
1301every commit they create, thereby allowing future branch creation
Junio C Hamanoba4b9282008-07-06 05:20:311302from any imported commit.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531303<div class="paragraph"><p>The <code>data</code> command following <code>committer</code> must supply the commit
1304message (see below for <code>data</code> command syntax). To import an empty
Junio C Hamanodf60f442007-02-07 05:52:371305commit message use a 0 length data. Commit messages are free-form
1306and are not interpreted by Git. Currently they must be encoded in
Junio C Hamanoba4b9282008-07-06 05:20:311307UTF-8, as fast-import does not permit other encodings to be specified.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531308<div class="paragraph"><p>Zero or more <code>filemodify</code>, <code>filedelete</code>, <code>filecopy</code>, <code>filerename</code>,
1309<code>filedeleteall</code> and <code>notemodify</code> commands
Junio C Hamanodfc4ce72007-02-07 23:17:291310may be included to update the contents of the branch prior to
1311creating the commit. These commands may be supplied in any order.
Junio C Hamanoc14e6ad2014-10-31 20:25:531312However it is recommended that a <code>filedeleteall</code> command precede
1313all <code>filemodify</code>, <code>filecopy</code>, <code>filerename</code> and <code>notemodify</code> commands in
1314the same commit, as <code>filedeleteall</code> wipes the branch clean (see below).</p></div>
1315<div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111316<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531317<h4 id="_code_author_code"><code>author</code></h4>
1318<div class="paragraph"><p>An <code>author</code> command may optionally appear, if the author information
1319might differ from the committer information. If <code>author</code> is omitted
Junio C Hamano68cf15a2010-11-06 01:01:591320then fast-import will automatically use the committer&#8217;s information for
Junio C Hamanodf60f442007-02-07 05:52:371321the author portion of the commit. See below for a description of
Junio C Hamanoc14e6ad2014-10-31 20:25:531322the fields in <code>author</code>, as they are identical to <code>committer</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111323</div>
1324<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531325<h4 id="_code_committer_code"><code>committer</code></h4>
1326<div class="paragraph"><p>The <code>committer</code> command indicates who made this commit, and when
Junio C Hamanoba4b9282008-07-06 05:20:311327they made it.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531328<div class="paragraph"><p>Here <code>&lt;name&gt;</code> is the person&#8217;s display name (for example
1329&#8220;Com M Itter&#8221;) and <code>&lt;email&gt;</code> is the person&#8217;s email address
1330(&#8220;cm@example.com&#8221;). <code>LT</code> and <code>GT</code> are the literal less-than (\x3c)
Junio C Hamanodf60f442007-02-07 05:52:371331and greater-than (\x3e) symbols. These are required to delimit
1332the email address from the other fields in the line. Note that
Junio C Hamanoc14e6ad2014-10-31 20:25:531333<code>&lt;name&gt;</code> and <code>&lt;email&gt;</code> are free-form and may contain any sequence
1334of bytes, except <code>LT</code>, <code>GT</code> and <code>LF</code>. <code>&lt;name&gt;</code> is typically UTF-8 encoded.</p></div>
1335<div class="paragraph"><p>The time of the change is specified by <code>&lt;when&gt;</code> using the date format
Junio C Hamanoe1aeb5e2014-06-06 19:16:291336that was selected by the --date-format=&lt;fmt&gt; command-line option.
Junio C Hamanodf60f442007-02-07 05:52:371337See &#8220;Date Formats&#8221; above for the set of supported formats, and
Junio C Hamanoba4b9282008-07-06 05:20:311338their syntax.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111339</div>
1340<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531341<h4 id="_code_from_code"><code>from</code></h4>
1342<div class="paragraph"><p>The <code>from</code> command is used to specify the commit to initialize
Junio C Hamano5dad0832007-02-13 05:16:231343this branch from. This revision will be the first ancestor of the
Junio C Hamanoac28f432012-11-21 21:58:581344new commit. The state of the tree built at this commit will begin
Junio C Hamanoc14e6ad2014-10-31 20:25:531345with the state at the <code>from</code> commit, and be altered by the content
Junio C Hamanoac28f432012-11-21 21:58:581346modifications in this commit.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531347<div class="paragraph"><p>Omitting the <code>from</code> command in the first commit of a new branch
Junio C Hamano5dad0832007-02-13 05:16:231348will cause fast-import to create that commit with no ancestor. This
1349tends to be desired only for the initial commit of a project.
Junio C Hamano25c0b702008-03-23 09:41:371350If the frontend creates all files from scratch when making a new
Junio C Hamanoc14e6ad2014-10-31 20:25:531351branch, a <code>merge</code> command may be used instead of <code>from</code> to start
Junio C Hamano25c0b702008-03-23 09:41:371352the commit with an empty tree.
Junio C Hamanoc14e6ad2014-10-31 20:25:531353Omitting the <code>from</code> command on existing branches is usually desired,
Junio C Hamano5dad0832007-02-13 05:16:231354as the current commit on that branch is automatically assumed to
Junio C Hamanoba4b9282008-07-06 05:20:311355be the first ancestor of the new commit.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531356<div class="paragraph"><p>As <code>LF</code> is not valid in a Git refname or SHA-1 expression, no
1357quoting or escaping syntax is supported within <code>&lt;commit-ish&gt;</code>.</p></div>
1358<div class="paragraph"><p>Here <code>&lt;commit-ish&gt;</code> is any of the following:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591359<div class="ulist"><ul>
Junio C Hamanodf60f442007-02-07 05:52:371360<li>
1361<p>
Junio C Hamano68cf15a2010-11-06 01:01:591362The name of an existing branch already in fast-import&#8217;s internal branch
1363 table. If fast-import doesn&#8217;t know the name, it&#8217;s treated as a SHA-1
Junio C Hamanodf60f442007-02-07 05:52:371364 expression.
1365</p>
1366</li>
1367<li>
1368<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531369A mark reference, <code>:&lt;idnum&gt;</code>, where <code>&lt;idnum&gt;</code> is the mark number.
Junio C Hamanodf60f442007-02-07 05:52:371370</p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531371<div class="paragraph"><p>The reason fast-import uses <code>:</code> to denote a mark reference is this character
1372is not legal in a Git branch name. The leading <code>:</code> makes it easy
1373to distinguish between the mark 42 (<code>:42</code>) and the branch 42 (<code>42</code>
1374or <code>refs/heads/42</code>), or an abbreviated SHA-1 which happened to
Junio C Hamanoba4b9282008-07-06 05:20:311375consist only of base-10 digits.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531376<div class="paragraph"><p>Marks must be declared (via <code>mark</code>) before they can be used.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371377</li>
1378<li>
1379<p>
1380A complete 40 byte or abbreviated commit SHA-1 in hex.
1381</p>
1382</li>
1383<li>
1384<p>
1385Any valid Git SHA-1 expression that resolves to a commit. See
Junio C Hamanoa28a9202012-06-21 07:08:231386 &#8220;SPECIFYING REVISIONS&#8221; in <a href="gitrevisions.html">gitrevisions(7)</a> for details.
Junio C Hamanodf60f442007-02-07 05:52:371387</p>
1388</li>
Junio C Hamanoc8c398a2014-06-16 21:14:051389<li>
1390<p>
1391The special null SHA-1 (40 zeros) specifies that the branch is to be
1392 removed.
1393</p>
1394</li>
Junio C Hamanoba4b9282008-07-06 05:20:311395</ul></div>
Junio C Hamano68cf15a2010-11-06 01:01:591396<div class="paragraph"><p>The special case of restarting an incremental import from the
Junio C Hamanoba4b9282008-07-06 05:20:311397current branch value should be written as:</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371398<div class="listingblock">
1399<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531400<pre><code> from refs/heads/branch^0</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371401</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531402<div class="paragraph"><p>The <code>^0</code> suffix is necessary as fast-import does not permit a branch to
Junio C Hamanodf60f442007-02-07 05:52:371403start from itself, and the branch is created in memory before the
Junio C Hamanoc14e6ad2014-10-31 20:25:531404<code>from</code> command is even read from the input. Adding <code>^0</code> will force
Junio C Hamano68cf15a2010-11-06 01:01:591405fast-import to resolve the commit through Git&#8217;s revision parsing library,
Junio C Hamanodf60f442007-02-07 05:52:371406rather than its internal branch table, thereby loading in the
Junio C Hamanoba4b9282008-07-06 05:20:311407existing value of the branch.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111408</div>
1409<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531410<h4 id="_code_merge_code"><code>merge</code></h4>
Junio C Hamanoac28f432012-11-21 21:58:581411<div class="paragraph"><p>Includes one additional ancestor commit. The additional ancestry
1412link does not change the way the tree state is built at this commit.
Junio C Hamanoc14e6ad2014-10-31 20:25:531413If the <code>from</code> command is
1414omitted when creating a new branch, the first <code>merge</code> commit will be
Junio C Hamano25c0b702008-03-23 09:41:371415the first ancestor of the current commit, and the branch will start
Junio C Hamanoc14e6ad2014-10-31 20:25:531416out with no files. An unlimited number of <code>merge</code> commands per
Junio C Hamanoe35ff422015-04-14 21:45:211417commit are permitted by fast-import, thereby establishing an n-way merge.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531418<div class="paragraph"><p>Here <code>&lt;commit-ish&gt;</code> is any of the commit specification expressions
1419also accepted by <code>from</code> (see above).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111420</div>
1421<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531422<h4 id="_code_filemodify_code"><code>filemodify</code></h4>
1423<div class="paragraph"><p>Included in a <code>commit</code> command to add a new file or change the
Junio C Hamanodf60f442007-02-07 05:52:371424content of an existing file. This command has two different means
Junio C Hamanoba4b9282008-07-06 05:20:311425of specifying the content of the file.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591426<div class="dlist"><dl>
1427<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:371428External data format
1429</dt>
1430<dd>
1431<p>
1432 The data content for the file was already supplied by a prior
Junio C Hamanoc14e6ad2014-10-31 20:25:531433 <code>blob</code> command. The frontend just needs to connect it.
Junio C Hamanodf60f442007-02-07 05:52:371434</p>
1435<div class="literalblock">
1436<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531437<pre><code> 'M' SP &lt;mode&gt; SP &lt;dataref&gt; SP &lt;path&gt; LF</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371438</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531439<div class="paragraph"><p>Here usually <code>&lt;dataref&gt;</code> must be either a mark reference (<code>:&lt;idnum&gt;</code>)
1440set by a prior <code>blob</code> command, or a full 40-byte SHA-1 of an
1441existing Git blob object. If <code>&lt;mode&gt;</code> is <code>040000`</code> then
1442<code>&lt;dataref&gt;</code> must be the full 40-byte SHA-1 of an existing
1443Git tree object or a mark reference set with <code>--import-marks</code>.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371444</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591445<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:371446Inline data format
1447</dt>
1448<dd>
1449<p>
1450 The data content for the file has not been supplied yet.
1451 The frontend wants to supply it as part of this modify
1452 command.
1453</p>
1454<div class="literalblock">
1455<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531456<pre><code> 'M' SP &lt;mode&gt; SP 'inline' SP &lt;path&gt; LF
1457 data</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371458</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531459<div class="paragraph"><p>See below for a detailed description of the <code>data</code> command.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371460</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311461</dl></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531462<div class="paragraph"><p>In both formats <code>&lt;mode&gt;</code> is the type of file entry, specified
Junio C Hamanoba4b9282008-07-06 05:20:311463in octal. Git only supports the following modes:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591464<div class="ulist"><ul>
Junio C Hamanodf60f442007-02-07 05:52:371465<li>
1466<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531467<code>100644</code> or <code>644</code>: A normal (not-executable) file. The majority
Junio C Hamanodf60f442007-02-07 05:52:371468 of files in most projects use this mode. If in doubt, this is
1469 what you want.
1470</p>
1471</li>
1472<li>
1473<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531474<code>100755</code> or <code>755</code>: A normal, but executable, file.
Junio C Hamanodf60f442007-02-07 05:52:371475</p>
1476</li>
1477<li>
1478<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531479<code>120000</code>: A symlink, the content of the file will be the link target.
Junio C Hamanodf60f442007-02-07 05:52:371480</p>
1481</li>
Junio C Hamano915cd9b2008-07-20 01:24:171482<li>
1483<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531484<code>160000</code>: A gitlink, SHA-1 of the object refers to a commit in
Junio C Hamano915cd9b2008-07-20 01:24:171485 another repository. Git links can only be specified by SHA or through
1486 a commit mark. They are used to implement submodules.
1487</p>
1488</li>
Junio C Hamano619596a2010-08-18 22:15:351489<li>
1490<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531491<code>040000</code>: A subdirectory. Subdirectories can only be specified by
1492 SHA or through a tree mark set with <code>--import-marks</code>.
Junio C Hamano619596a2010-08-18 22:15:351493</p>
1494</li>
Junio C Hamanoba4b9282008-07-06 05:20:311495</ul></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531496<div class="paragraph"><p>In both formats <code>&lt;path&gt;</code> is the complete path of the file to be added
Junio C Hamanoba4b9282008-07-06 05:20:311497(if not already existing) or modified (if already existing).</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531498<div class="paragraph"><p>A <code>&lt;path&gt;</code> string must use UNIX-style directory separators (forward
1499slash <code>/</code>), may contain any byte other than <code>LF</code>, and must not
1500start with double quote (<code>"</code>).</p></div>
Junio C Hamanobccb0db2012-11-29 22:51:201501<div class="paragraph"><p>A path can use C-style string quoting; this is accepted in all cases
1502and mandatory if the filename starts with double quote or contains
Junio C Hamanoc14e6ad2014-10-31 20:25:531503<code>LF</code>. In C-style quoting, the complete name should be surrounded with
1504double quotes, and any <code>LF</code>, backslash, or double quote characters
Junio C Hamanobccb0db2012-11-29 22:51:201505must be escaped by preceding them with a backslash (e.g.,
Junio C Hamanoc14e6ad2014-10-31 20:25:531506<code>"path/with\n, \\ and \" in it"</code>).</p></div>
1507<div class="paragraph"><p>The value of <code>&lt;path&gt;</code> must be in canonical form. That is it must not:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591508<div class="ulist"><ul>
Junio C Hamanodf60f442007-02-07 05:52:371509<li>
1510<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531511contain an empty directory component (e.g. <code>foo//bar</code> is invalid),
Junio C Hamanodf60f442007-02-07 05:52:371512</p>
1513</li>
1514<li>
1515<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531516end with a directory separator (e.g. <code>foo/</code> is invalid),
Junio C Hamanodf60f442007-02-07 05:52:371517</p>
1518</li>
1519<li>
1520<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531521start with a directory separator (e.g. <code>/foo</code> is invalid),
Junio C Hamanodf60f442007-02-07 05:52:371522</p>
1523</li>
1524<li>
1525<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531526contain the special component <code>.</code> or <code>..</code> (e.g. <code>foo/./bar</code> and
1527 <code>foo/../bar</code> are invalid).
Junio C Hamanodf60f442007-02-07 05:52:371528</p>
1529</li>
Junio C Hamanoba4b9282008-07-06 05:20:311530</ul></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531531<div class="paragraph"><p>The root of the tree can be represented by an empty string as <code>&lt;path&gt;</code>.</p></div>
1532<div class="paragraph"><p>It is recommended that <code>&lt;path&gt;</code> always be encoded using UTF-8.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111533</div>
1534<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531535<h4 id="_code_filedelete_code"><code>filedelete</code></h4>
1536<div class="paragraph"><p>Included in a <code>commit</code> command to remove a file or recursively
Junio C Hamano06216df2007-07-10 07:49:371537delete an entire directory from the branch. If the file or directory
1538removal makes its parent directory empty, the parent directory will
Junio C Hamanodf60f442007-02-07 05:52:371539be automatically removed too. This cascades up the tree until the
Junio C Hamanoba4b9282008-07-06 05:20:311540first non-empty directory or the root is reached.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371541<div class="literalblock">
1542<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531543<pre><code> 'D' SP &lt;path&gt; LF</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371544</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531545<div class="paragraph"><p>here <code>&lt;path&gt;</code> is the complete path of the file or subdirectory to
Junio C Hamano06216df2007-07-10 07:49:371546be removed from the branch.
Junio C Hamanoc14e6ad2014-10-31 20:25:531547See <code>filemodify</code> above for a detailed description of <code>&lt;path&gt;</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111548</div>
1549<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531550<h4 id="_code_filecopy_code"><code>filecopy</code></h4>
Junio C Hamano68cf15a2010-11-06 01:01:591551<div class="paragraph"><p>Recursively copies an existing file or subdirectory to a different
Junio C Hamanoc0ea7c62007-07-15 07:19:061552location within the branch. The existing file or directory must
1553exist. If the destination exists it will be completely replaced
Junio C Hamanoba4b9282008-07-06 05:20:311554by the content copied from the source.</p></div>
Junio C Hamanoc0ea7c62007-07-15 07:19:061555<div class="literalblock">
1556<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531557<pre><code> 'C' SP &lt;path&gt; SP &lt;path&gt; LF</code></pre>
Junio C Hamanoc0ea7c62007-07-15 07:19:061558</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531559<div class="paragraph"><p>here the first <code>&lt;path&gt;</code> is the source location and the second
1560<code>&lt;path&gt;</code> is the destination. See <code>filemodify</code> above for a detailed
1561description of what <code>&lt;path&gt;</code> may look like. To use a source path
Junio C Hamanoba4b9282008-07-06 05:20:311562that contains SP the path must be quoted.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531563<div class="paragraph"><p>A <code>filecopy</code> command takes effect immediately. Once the source
Junio C Hamanoc0ea7c62007-07-15 07:19:061564location has been copied to the destination any future commands
1565applied to the source location will not impact the destination of
Junio C Hamanoba4b9282008-07-06 05:20:311566the copy.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111567</div>
1568<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531569<h4 id="_code_filerename_code"><code>filerename</code></h4>
Junio C Hamano68cf15a2010-11-06 01:01:591570<div class="paragraph"><p>Renames an existing file or subdirectory to a different location
Junio C Hamano06216df2007-07-10 07:49:371571within the branch. The existing file or directory must exist. If
Junio C Hamanoba4b9282008-07-06 05:20:311572the destination exists it will be replaced by the source directory.</p></div>
Junio C Hamano06216df2007-07-10 07:49:371573<div class="literalblock">
1574<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531575<pre><code> 'R' SP &lt;path&gt; SP &lt;path&gt; LF</code></pre>
Junio C Hamano06216df2007-07-10 07:49:371576</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531577<div class="paragraph"><p>here the first <code>&lt;path&gt;</code> is the source location and the second
1578<code>&lt;path&gt;</code> is the destination. See <code>filemodify</code> above for a detailed
1579description of what <code>&lt;path&gt;</code> may look like. To use a source path
Junio C Hamanoba4b9282008-07-06 05:20:311580that contains SP the path must be quoted.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531581<div class="paragraph"><p>A <code>filerename</code> command takes effect immediately. Once the source
Junio C Hamano06216df2007-07-10 07:49:371582location has been renamed to the destination any future commands
1583applied to the source location will create new files there and not
Junio C Hamanoba4b9282008-07-06 05:20:311584impact the destination of the rename.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531585<div class="paragraph"><p>Note that a <code>filerename</code> is the same as a <code>filecopy</code> followed by a
1586<code>filedelete</code> of the source location. There is a slight performance
1587advantage to using <code>filerename</code>, but the advantage is so small
Junio C Hamanoc0ea7c62007-07-15 07:19:061588that it is never worth trying to convert a delete/add pair in
Junio C Hamanoc14e6ad2014-10-31 20:25:531589source material into a rename for fast-import. This <code>filerename</code>
Junio C Hamanoc0ea7c62007-07-15 07:19:061590command is provided just to simplify frontends that already have
Junio C Hamano68cf15a2010-11-06 01:01:591591rename information and don&#8217;t want bother with decomposing it into a
Junio C Hamanoc14e6ad2014-10-31 20:25:531592<code>filecopy</code> followed by a <code>filedelete</code>.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111593</div>
1594<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531595<h4 id="_code_filedeleteall_code"><code>filedeleteall</code></h4>
1596<div class="paragraph"><p>Included in a <code>commit</code> command to remove all files (and also all
Junio C Hamanodfc4ce72007-02-07 23:17:291597directories) from the branch. This command resets the internal
1598branch structure to have no files in it, allowing the frontend
Junio C Hamanoba4b9282008-07-06 05:20:311599to subsequently add all interesting files from scratch.</p></div>
Junio C Hamanodfc4ce72007-02-07 23:17:291600<div class="literalblock">
1601<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531602<pre><code> 'deleteall' LF</code></pre>
Junio C Hamanodfc4ce72007-02-07 23:17:291603</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591604<div class="paragraph"><p>This command is extremely useful if the frontend does not know
Junio C Hamanodfc4ce72007-02-07 23:17:291605(or does not care to know) what files are currently on the branch,
Junio C Hamanoc14e6ad2014-10-31 20:25:531606and therefore cannot generate the proper <code>filedelete</code> commands to
Junio C Hamanoba4b9282008-07-06 05:20:311607update the content.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531608<div class="paragraph"><p>Issuing a <code>filedeleteall</code> followed by the needed <code>filemodify</code>
Junio C Hamanodfc4ce72007-02-07 23:17:291609commands to set the correct content will produce the same results
Junio C Hamanoc14e6ad2014-10-31 20:25:531610as sending only the needed <code>filemodify</code> and <code>filedelete</code> commands.
1611The <code>filedeleteall</code> approach may however require fast-import to use slightly
Junio C Hamanodfc4ce72007-02-07 23:17:291612more memory per active branch (less than 1 MiB for even most large
1613projects); so frontends that can easily obtain only the affected
Junio C Hamanoba4b9282008-07-06 05:20:311614paths for a commit are encouraged to do so.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111615</div>
1616<div class="sect3">
Junio C Hamanoc14e6ad2014-10-31 20:25:531617<h4 id="_code_notemodify_code"><code>notemodify</code></h4>
1618<div class="paragraph"><p>Included in a <code>commit</code> <code>&lt;notes_ref&gt;</code> command to add a new note
1619annotating a <code>&lt;commit-ish&gt;</code> or change this annotation contents.
1620Internally it is similar to filemodify 100644 on <code>&lt;commit-ish&gt;</code>
Junio C Hamano15567bc2011-07-23 00:51:591621path (maybe split into subdirectories). It&#8217;s not advised to
Junio C Hamanoc14e6ad2014-10-31 20:25:531622use any other commands to write to the <code>&lt;notes_ref&gt;</code> tree except
1623<code>filedeleteall</code> to delete all existing notes in this tree.
Junio C Hamano15567bc2011-07-23 00:51:591624This command has two different means of specifying the content
1625of the note.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591626<div class="dlist"><dl>
1627<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:371628External data format
1629</dt>
1630<dd>
1631<p>
1632 The data content for the note was already supplied by a prior
Junio C Hamanoc14e6ad2014-10-31 20:25:531633 <code>blob</code> command. The frontend just needs to connect it to the
Junio C Hamano3b70d3c2009-11-21 17:37:371634 commit that is to be annotated.
1635</p>
1636<div class="literalblock">
1637<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531638<pre><code> 'N' SP &lt;dataref&gt; SP &lt;commit-ish&gt; LF</code></pre>
Junio C Hamano3b70d3c2009-11-21 17:37:371639</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531640<div class="paragraph"><p>Here <code>&lt;dataref&gt;</code> can be either a mark reference (<code>:&lt;idnum&gt;</code>)
1641set by a prior <code>blob</code> command, or a full 40-byte SHA-1 of an
Junio C Hamano3b70d3c2009-11-21 17:37:371642existing Git blob object.</p></div>
1643</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591644<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:371645Inline data format
1646</dt>
1647<dd>
1648<p>
1649 The data content for the note has not been supplied yet.
1650 The frontend wants to supply it as part of this modify
1651 command.
1652</p>
1653<div class="literalblock">
1654<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531655<pre><code> 'N' SP 'inline' SP &lt;commit-ish&gt; LF
1656 data</code></pre>
Junio C Hamano3b70d3c2009-11-21 17:37:371657</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531658<div class="paragraph"><p>See below for a detailed description of the <code>data</code> command.</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:371659</dd>
1660</dl></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531661<div class="paragraph"><p>In both formats <code>&lt;commit-ish&gt;</code> is any of the commit specification
1662expressions also accepted by <code>from</code> (see above).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111663</div>
1664</div>
1665<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531666<h3 id="_code_mark_code"><code>mark</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591667<div class="paragraph"><p>Arranges for fast-import to save a reference to the current object, allowing
Junio C Hamanodf60f442007-02-07 05:52:371668the frontend to recall this object at a future point in time, without
1669knowing its SHA-1. Here the current object is the object creation
Junio C Hamanoc14e6ad2014-10-31 20:25:531670command the <code>mark</code> command appears within. This can be <code>commit</code>,
1671<code>tag</code>, and <code>blob</code>, but <code>commit</code> is the most common usage.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371672<div class="literalblock">
1673<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531674<pre><code> 'mark' SP ':' &lt;idnum&gt; LF</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371675</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531676<div class="paragraph"><p>where <code>&lt;idnum&gt;</code> is the number assigned by the frontend to this mark.
1677The value of <code>&lt;idnum&gt;</code> is expressed as an ASCII decimal integer.
Junio C Hamanodf60f442007-02-07 05:52:371678The value 0 is reserved and cannot be used as
Junio C Hamanoba4b9282008-07-06 05:20:311679a mark. Only values greater than or equal to 1 may be used as marks.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591680<div class="paragraph"><p>New marks are created automatically. Existing marks can be moved
Junio C Hamanoc14e6ad2014-10-31 20:25:531681to another object simply by reusing the same <code>&lt;idnum&gt;</code> in another
1682<code>mark</code> command.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111683</div>
1684<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531685<h3 id="_code_tag_code"><code>tag</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591686<div class="paragraph"><p>Creates an annotated tag referring to a specific commit. To create
Junio C Hamanoc14e6ad2014-10-31 20:25:531687lightweight (non-annotated) tags see the <code>reset</code> command below.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371688<div class="literalblock">
1689<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531690<pre><code> 'tag' SP &lt;name&gt; LF
Junio C Hamanoe6f28d02013-09-17 21:34:001691 'from' SP &lt;commit-ish&gt; LF
Junio C Hamano6d325df2010-01-01 00:02:471692 'tagger' (SP &lt;name&gt;)? SP LT &lt;email&gt; GT SP &lt;when&gt; LF
Junio C Hamanoc14e6ad2014-10-31 20:25:531693 data</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371694</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531695<div class="paragraph"><p>where <code>&lt;name&gt;</code> is the name of the tag to create.</p></div>
1696<div class="paragraph"><p>Tag names are automatically prefixed with <code>refs/tags/</code> when stored
1697in Git, so importing the CVS branch symbol <code>RELENG-1_0-FINAL</code> would
1698use just <code>RELENG-1_0-FINAL</code> for <code>&lt;name&gt;</code>, and fast-import will write the
1699corresponding ref as <code>refs/tags/RELENG-1_0-FINAL</code>.</p></div>
1700<div class="paragraph"><p>The value of <code>&lt;name&gt;</code> must be a valid refname in Git and therefore
1701may contain forward slashes. As <code>LF</code> is not valid in a Git refname,
Junio C Hamanoba4b9282008-07-06 05:20:311702no quoting or escaping syntax is supported here.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531703<div class="paragraph"><p>The <code>from</code> command is the same as in the <code>commit</code> command; see
Junio C Hamanoba4b9282008-07-06 05:20:311704above for details.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531705<div class="paragraph"><p>The <code>tagger</code> command uses the same format as <code>committer</code> within
1706<code>commit</code>; again see above for details.</p></div>
1707<div class="paragraph"><p>The <code>data</code> command following <code>tagger</code> must supply the annotated tag
1708message (see below for <code>data</code> command syntax). To import an empty
Junio C Hamanodf60f442007-02-07 05:52:371709tag message use a 0 length data. Tag messages are free-form and are
1710not interpreted by Git. Currently they must be encoded in UTF-8,
Junio C Hamanoba4b9282008-07-06 05:20:311711as fast-import does not permit other encodings to be specified.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591712<div class="paragraph"><p>Signing annotated tags during import from within fast-import is not
Junio C Hamanodf60f442007-02-07 05:52:371713supported. Trying to include your own PGP/GPG signature is not
1714recommended, as the frontend does not (easily) have access to the
1715complete set of bytes which normally goes into such a signature.
Junio C Hamanod3339982007-02-09 08:38:481716If signing is required, create lightweight tags from within fast-import with
Junio C Hamanoc14e6ad2014-10-31 20:25:531717<code>reset</code>, then create the annotated versions of those tags offline
Junio C Hamano1aa40d22010-01-21 17:46:431718with the standard <em>git tag</em> process.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111719</div>
1720<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531721<h3 id="_code_reset_code"><code>reset</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591722<div class="paragraph"><p>Creates (or recreates) the named branch, optionally starting from
Junio C Hamanodf60f442007-02-07 05:52:371723a specific revision. The reset command allows a frontend to issue
Junio C Hamanoc14e6ad2014-10-31 20:25:531724a new <code>from</code> command for an existing branch, or to create a new
Junio C Hamanoba4b9282008-07-06 05:20:311725branch from an existing commit without creating a new commit.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371726<div class="literalblock">
1727<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531728<pre><code> 'reset' SP &lt;ref&gt; LF
Junio C Hamanoe6f28d02013-09-17 21:34:001729 ('from' SP &lt;commit-ish&gt; LF)?
Junio C Hamanoc14e6ad2014-10-31 20:25:531730 LF?</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371731</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531732<div class="paragraph"><p>For a detailed description of <code>&lt;ref&gt;</code> and <code>&lt;commit-ish&gt;</code> see above
1733under <code>commit</code> and <code>from</code>.</p></div>
1734<div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div>
1735<div class="paragraph"><p>The <code>reset</code> command can also be used to create lightweight
Junio C Hamanoba4b9282008-07-06 05:20:311736(non-annotated) tags. For example:</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371737<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:111738<div class="content">
Junio C Hamanodf60f442007-02-07 05:52:371739<div class="literalblock">
1740<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531741<pre><code>reset refs/tags/938
1742from :938</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371743</div></div>
1744</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531745<div class="paragraph"><p>would create the lightweight tag <code>refs/tags/938</code> referring to
1746whatever commit mark <code>:938</code> references.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111747</div>
1748<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531749<h3 id="_code_blob_code"><code>blob</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591750<div class="paragraph"><p>Requests writing one file revision to the packfile. The revision
Junio C Hamanodf60f442007-02-07 05:52:371751is not connected to any commit; this connection must be formed in
Junio C Hamanoc14e6ad2014-10-31 20:25:531752a subsequent <code>commit</code> command by referencing the blob through an
Junio C Hamanoba4b9282008-07-06 05:20:311753assigned mark.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371754<div class="literalblock">
1755<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531756<pre><code> 'blob' LF
Junio C Hamanodf60f442007-02-07 05:52:371757 mark?
Junio C Hamanoc14e6ad2014-10-31 20:25:531758 data</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371759</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591760<div class="paragraph"><p>The mark command is optional here as some frontends have chosen
Junio C Hamanodf60f442007-02-07 05:52:371761to generate the Git SHA-1 for the blob on their own, and feed that
Junio C Hamanoc14e6ad2014-10-31 20:25:531762directly to <code>commit</code>. This is typically more work than it&#8217;s worth
Junio C Hamanoba4b9282008-07-06 05:20:311763however, as marks are inexpensive to store and easy to use.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111764</div>
1765<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531766<h3 id="_code_data_code"><code>data</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591767<div class="paragraph"><p>Supplies raw data (for use as blob/file content, commit messages, or
Junio C Hamanod3339982007-02-09 08:38:481768annotated tag messages) to fast-import. Data can be supplied using an exact
Junio C Hamanodf60f442007-02-07 05:52:371769byte count or delimited with a terminating line. Real frontends
1770intended for production-quality conversions should always use the
1771exact byte count format, as it is more robust and performs better.
Junio C Hamanoba4b9282008-07-06 05:20:311772The delimited format is intended primarily for testing fast-import.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531773<div class="paragraph"><p>Comment lines appearing within the <code>&lt;raw&gt;</code> part of <code>data</code> commands
Junio C Hamanoe52cf782007-08-19 19:15:521774are always taken to be part of the body of the data and are therefore
1775never ignored by fast-import. This makes it safe to import any
Junio C Hamanoc14e6ad2014-10-31 20:25:531776file/message content whose lines might start with <code>#</code>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591777<div class="dlist"><dl>
1778<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:371779Exact byte count format
1780</dt>
1781<dd>
1782<p>
1783 The frontend must specify the number of bytes of data.
1784</p>
1785<div class="literalblock">
1786<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531787<pre><code> 'data' SP &lt;count&gt; LF
1788 &lt;raw&gt; LF?</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371789</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531790<div class="paragraph"><p>where <code>&lt;count&gt;</code> is the exact number of bytes appearing within
1791<code>&lt;raw&gt;</code>. The value of <code>&lt;count&gt;</code> is expressed as an ASCII decimal
1792integer. The <code>LF</code> on either side of <code>&lt;raw&gt;</code> is not
1793included in <code>&lt;count&gt;</code> and will not be included in the imported data.</p></div>
1794<div class="paragraph"><p>The <code>LF</code> after <code>&lt;raw&gt;</code> is optional (it used to be required) but
Junio C Hamanoe52cf782007-08-19 19:15:521795recommended. Always including it makes debugging a fast-import
1796stream easier as the next command always starts in column 0
Junio C Hamanoc14e6ad2014-10-31 20:25:531797of the next line, even if <code>&lt;raw&gt;</code> did not end with an <code>LF</code>.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371798</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591799<dt class="hdlist1">
Junio C Hamanodf60f442007-02-07 05:52:371800Delimited format
1801</dt>
1802<dd>
1803<p>
1804 A delimiter string is used to mark the end of the data.
Junio C Hamanod3339982007-02-09 08:38:481805 fast-import will compute the length by searching for the delimiter.
Junio C Hamanoa6387422007-08-25 03:54:271806 This format is primarily useful for testing and is not
Junio C Hamanodf60f442007-02-07 05:52:371807 recommended for real data.
1808</p>
1809<div class="literalblock">
1810<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531811<pre><code> 'data' SP '&lt;&lt;' &lt;delim&gt; LF
Junio C Hamanodf60f442007-02-07 05:52:371812 &lt;raw&gt; LF
Junio C Hamanoe52cf782007-08-19 19:15:521813 &lt;delim&gt; LF
Junio C Hamanoc14e6ad2014-10-31 20:25:531814 LF?</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371815</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531816<div class="paragraph"><p>where <code>&lt;delim&gt;</code> is the chosen delimiter string. The string <code>&lt;delim&gt;</code>
1817must not appear on a line by itself within <code>&lt;raw&gt;</code>, as otherwise
1818fast-import will think the data ends earlier than it really does. The <code>LF</code>
1819immediately trailing <code>&lt;raw&gt;</code> is part of <code>&lt;raw&gt;</code>. This is one of
Junio C Hamanodf60f442007-02-07 05:52:371820the limitations of the delimited format, it is impossible to supply
Junio C Hamanoba4b9282008-07-06 05:20:311821a data chunk which does not have an LF as its last byte.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531822<div class="paragraph"><p>The <code>LF</code> after <code>&lt;delim&gt; LF</code> is optional (it used to be required).</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371823</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311824</dl></div>
Junio C Hamano9d971152012-12-19 00:43:111825</div>
1826<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531827<h3 id="_code_checkpoint_code"><code>checkpoint</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591828<div class="paragraph"><p>Forces fast-import to close the current packfile, start a new one, and to
Junio C Hamanoba4b9282008-07-06 05:20:311829save out all current branch refs, tags and marks.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:371830<div class="literalblock">
1831<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531832<pre><code> 'checkpoint' LF
1833 LF?</code></pre>
Junio C Hamanodf60f442007-02-07 05:52:371834</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591835<div class="paragraph"><p>Note that fast-import automatically switches packfiles when the current
Junio C Hamanodfc4ce72007-02-07 23:17:291836packfile reaches --max-pack-size, or 4 GiB, whichever limit is
Junio C Hamanod3339982007-02-09 08:38:481837smaller. During an automatic packfile switch fast-import does not update
Junio C Hamanoba4b9282008-07-06 05:20:311838the branch refs, tags or marks.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531839<div class="paragraph"><p>As a <code>checkpoint</code> can require a significant amount of CPU time and
Junio C Hamanodfc4ce72007-02-07 23:17:291840disk IO (to compute the overall pack SHA-1 checksum, generate the
1841corresponding index file, and update the refs) it can easily take
Junio C Hamanoc14e6ad2014-10-31 20:25:531842several minutes for a single <code>checkpoint</code> command to complete.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591843<div class="paragraph"><p>Frontends may choose to issue checkpoints during extremely large
Junio C Hamanodfc4ce72007-02-07 23:17:291844and long running imports, or when they need to allow another Git
1845process access to a branch. However given that a 30 GiB Subversion
Junio C Hamanod3339982007-02-09 08:38:481846repository can be loaded into Git through fast-import in about 3 hours,
Junio C Hamanoba4b9282008-07-06 05:20:311847explicit checkpointing may not be necessary.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531848<div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111849</div>
1850<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531851<h3 id="_code_progress_code"><code>progress</code></h3>
1852<div class="paragraph"><p>Causes fast-import to print the entire <code>progress</code> line unmodified to
Junio C Hamanoe52cf782007-08-19 19:15:521853its standard output channel (file descriptor 1) when the command is
1854processed from the input stream. The command otherwise has no impact
Junio C Hamano68cf15a2010-11-06 01:01:591855on the current import, or on any of fast-import&#8217;s internal state.</p></div>
Junio C Hamanoe52cf782007-08-19 19:15:521856<div class="literalblock">
1857<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531858<pre><code> 'progress' SP &lt;any&gt; LF
1859 LF?</code></pre>
Junio C Hamanoe52cf782007-08-19 19:15:521860</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531861<div class="paragraph"><p>The <code>&lt;any&gt;</code> part of the command may contain any sequence of bytes
1862that does not contain <code>LF</code>. The <code>LF</code> after the command is optional.
Junio C Hamanoe52cf782007-08-19 19:15:521863Callers may wish to process the output through a tool such as sed to
Junio C Hamanoba4b9282008-07-06 05:20:311864remove the leading part of the line, for example:</p></div>
Junio C Hamanoe52cf782007-08-19 19:15:521865<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:111866<div class="content">
Junio C Hamanoe52cf782007-08-19 19:15:521867<div class="literalblock">
1868<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531869<pre><code>frontend | git fast-import | sed 's/^progress //'</code></pre>
Junio C Hamanoe52cf782007-08-19 19:15:521870</div></div>
1871</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531872<div class="paragraph"><p>Placing a <code>progress</code> command immediately after a <code>checkpoint</code> will
1873inform the reader when the <code>checkpoint</code> has been completed and it
Junio C Hamanoba4b9282008-07-06 05:20:311874can safely access the refs that fast-import updated.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111875</div>
1876<div class="sect2">
Junio C Hamanod7ed4042015-08-03 19:43:001877<h3 id="_code_get_mark_code"><code>get-mark</code></h3>
1878<div class="paragraph"><p>Causes fast-import to print the SHA-1 corresponding to a mark to
1879stdout or to the file descriptor previously arranged with the
1880<code>--cat-blob-fd</code> argument. The command otherwise has no impact on the
1881current import; its purpose is to retrieve SHA-1s that later commits
1882might want to refer to in their commit messages.</p></div>
1883<div class="literalblock">
1884<div class="content">
1885<pre><code> 'get-mark' SP ':' &lt;idnum&gt; LF</code></pre>
1886</div></div>
1887<div class="paragraph"><p>This command can be used anywhere in the stream that comments are
1888accepted. In particular, the <code>get-mark</code> command can be used in the
1889middle of a commit but not in the middle of a <code>data</code> command.</p></div>
1890<div class="paragraph"><p>See &#8220;Responses To Commands&#8221; below for details about how to read
1891this output safely.</p></div>
1892</div>
1893<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531894<h3 id="_code_cat_blob_code"><code>cat-blob</code></h3>
Junio C Hamano0d75e872010-12-17 06:57:261895<div class="paragraph"><p>Causes fast-import to print a blob to a file descriptor previously
Junio C Hamanoc14e6ad2014-10-31 20:25:531896arranged with the <code>--cat-blob-fd</code> argument. The command otherwise
Junio C Hamano0d75e872010-12-17 06:57:261897has no impact on the current import; its main purpose is to
1898retrieve blobs that may be in fast-import&#8217;s memory but not
1899accessible from the target repository.</p></div>
1900<div class="literalblock">
1901<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531902<pre><code> 'cat-blob' SP &lt;dataref&gt; LF</code></pre>
Junio C Hamano0d75e872010-12-17 06:57:261903</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531904<div class="paragraph"><p>The <code>&lt;dataref&gt;</code> can be either a mark reference (<code>:&lt;idnum&gt;</code>)
Junio C Hamano0d75e872010-12-17 06:57:261905set previously or a full 40-byte SHA-1 of a Git blob, preexisting or
1906ready to be written.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531907<div class="paragraph"><p>Output uses the same format as <code>git cat-file --batch</code>:</p></div>
Junio C Hamano0d75e872010-12-17 06:57:261908<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:111909<div class="content">
Junio C Hamano0d75e872010-12-17 06:57:261910<div class="literalblock">
1911<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531912<pre><code>&lt;sha1&gt; SP 'blob' SP &lt;size&gt; LF
1913&lt;contents&gt; LF</code></pre>
Junio C Hamano0d75e872010-12-17 06:57:261914</div></div>
1915</div></div>
1916<div class="paragraph"><p>This command can be used anywhere in the stream that comments are
Junio C Hamanoc14e6ad2014-10-31 20:25:531917accepted. In particular, the <code>cat-blob</code> command can be used in the
1918middle of a commit but not in the middle of a <code>data</code> command.</p></div>
Junio C Hamano4eda1362012-04-23 20:55:491919<div class="paragraph"><p>See &#8220;Responses To Commands&#8221; below for details about how to read
1920this output safely.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111921</div>
1922<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531923<h3 id="_code_ls_code"><code>ls</code></h3>
Junio C Hamano73d10512011-03-01 01:02:381924<div class="paragraph"><p>Prints information about the object at a path to a file descriptor
Junio C Hamanoc14e6ad2014-10-31 20:25:531925previously arranged with the <code>--cat-blob-fd</code> argument. This allows
1926printing a blob from the active commit (with <code>cat-blob</code>) or copying a
Junio C Hamano73d10512011-03-01 01:02:381927blob or tree from a previous commit for use in the current one (with
Junio C Hamanoc14e6ad2014-10-31 20:25:531928<code>filemodify</code>).</p></div>
1929<div class="paragraph"><p>The <code>ls</code> command can be used anywhere in the stream that comments are
Junio C Hamano73d10512011-03-01 01:02:381930accepted, including the middle of a commit.</p></div>
1931<div class="dlist"><dl>
1932<dt class="hdlist1">
1933Reading from the active commit
1934</dt>
1935<dd>
1936<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531937 This form can only be used in the middle of a <code>commit</code>.
Junio C Hamano73d10512011-03-01 01:02:381938 The path names a directory entry within fast-import&#8217;s
1939 active commit. The path must be quoted in this case.
1940</p>
1941<div class="literalblock">
1942<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531943<pre><code> 'ls' SP &lt;path&gt; LF</code></pre>
Junio C Hamano73d10512011-03-01 01:02:381944</div></div>
1945</dd>
1946<dt class="hdlist1">
1947Reading from a named tree
1948</dt>
1949<dd>
1950<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531951 The <code>&lt;dataref&gt;</code> can be a mark reference (<code>:&lt;idnum&gt;</code>) or the
Junio C Hamano73d10512011-03-01 01:02:381952 full 40-byte SHA-1 of a Git tag, commit, or tree object,
1953 preexisting or waiting to be written.
1954 The path is relative to the top level of the tree
Junio C Hamanoc14e6ad2014-10-31 20:25:531955 named by <code>&lt;dataref&gt;</code>.
Junio C Hamano73d10512011-03-01 01:02:381956</p>
1957<div class="literalblock">
1958<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531959<pre><code> 'ls' SP &lt;dataref&gt; SP &lt;path&gt; LF</code></pre>
Junio C Hamano73d10512011-03-01 01:02:381960</div></div>
1961</dd>
1962</dl></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531963<div class="paragraph"><p>See <code>filemodify</code> above for a detailed description of <code>&lt;path&gt;</code>.</p></div>
1964<div class="paragraph"><p>Output uses the same format as <code>git ls-tree &lt;tree&gt; -- &lt;path&gt;</code>:</p></div>
Junio C Hamano73d10512011-03-01 01:02:381965<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:111966<div class="content">
Junio C Hamano73d10512011-03-01 01:02:381967<div class="literalblock">
1968<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531969<pre><code>&lt;mode&gt; SP ('blob' | 'tree' | 'commit') SP &lt;dataref&gt; HT &lt;path&gt; LF</code></pre>
Junio C Hamano73d10512011-03-01 01:02:381970</div></div>
1971</div></div>
1972<div class="paragraph"><p>The &lt;dataref&gt; represents the blob, tree, or commit object at &lt;path&gt;
Junio C Hamanod7ed4042015-08-03 19:43:001973and can be used in later <em>get-mark</em>, <em>cat-blob</em>, <em>filemodify</em>, or
1974<em>ls</em> commands.</p></div>
Junio C Hamano73d10512011-03-01 01:02:381975<div class="paragraph"><p>If there is no file or subtree at that path, <em>git fast-import</em> will
1976instead report</p></div>
1977<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:111978<div class="content">
Junio C Hamano73d10512011-03-01 01:02:381979<div class="literalblock">
1980<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531981<pre><code>missing SP &lt;path&gt; LF</code></pre>
Junio C Hamano73d10512011-03-01 01:02:381982</div></div>
1983</div></div>
Junio C Hamano4eda1362012-04-23 20:55:491984<div class="paragraph"><p>See &#8220;Responses To Commands&#8221; below for details about how to read
1985this output safely.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111986</div>
1987<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:531988<h3 id="_code_feature_code"><code>feature</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:591989<div class="paragraph"><p>Require that fast-import supports the specified feature, or abort if
Junio C Hamano6ce6b6c2010-01-18 01:25:501990it does not.</p></div>
1991<div class="literalblock">
1992<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531993<pre><code> 'feature' SP &lt;feature&gt; ('=' &lt;argument&gt;)? LF</code></pre>
Junio C Hamano6ce6b6c2010-01-18 01:25:501994</div></div>
Junio C Hamano0d75e872010-12-17 06:57:261995<div class="paragraph"><p>The &lt;feature&gt; part of the command may be any one of the following:</p></div>
1996<div class="dlist"><dl>
1997<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:501998date-format
Junio C Hamano0d75e872010-12-17 06:57:261999</dt>
2000<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:502001export-marks
Junio C Hamano0d75e872010-12-17 06:57:262002</dt>
2003<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:502004relative-marks
Junio C Hamano0d75e872010-12-17 06:57:262005</dt>
2006<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:502007no-relative-marks
Junio C Hamano0d75e872010-12-17 06:57:262008</dt>
2009<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:502010force
Junio C Hamano0d75e872010-12-17 06:57:262011</dt>
2012<dd>
2013<p>
2014 Act as though the corresponding command-line option with
Junio C Hamano92d80372016-07-13 22:00:052015 a leading <code>--</code> was passed on the command line
Junio C Hamano0d75e872010-12-17 06:57:262016 (see OPTIONS, above).
Junio C Hamano6ce6b6c2010-01-18 01:25:502017</p>
Junio C Hamano0d75e872010-12-17 06:57:262018</dd>
2019<dt class="hdlist1">
2020import-marks
2021</dt>
Junio C Hamanod8fa0222011-08-26 16:18:152022<dt class="hdlist1">
2023import-marks-if-exists
2024</dt>
Junio C Hamano0d75e872010-12-17 06:57:262025<dd>
2026<p>
2027 Like --import-marks except in two respects: first, only one
Junio C Hamanod8fa0222011-08-26 16:18:152028 "feature import-marks" or "feature import-marks-if-exists"
2029 command is allowed per stream; second, an --import-marks=
2030 or --import-marks-if-exists command-line option overrides
2031 any of these "feature" commands in the stream; third,
2032 "feature import-marks-if-exists" like a corresponding
2033 command-line option silently skips a nonexistent file.
Junio C Hamano0d75e872010-12-17 06:57:262034</p>
2035</dd>
2036<dt class="hdlist1">
Junio C Hamanod7ed4042015-08-03 19:43:002037get-mark
2038</dt>
2039<dt class="hdlist1">
Junio C Hamano0d75e872010-12-17 06:57:262040cat-blob
2041</dt>
Junio C Hamano73d10512011-03-01 01:02:382042<dt class="hdlist1">
2043ls
2044</dt>
Junio C Hamano0d75e872010-12-17 06:57:262045<dd>
2046<p>
Junio C Hamanod7ed4042015-08-03 19:43:002047 Require that the backend support the <em>get-mark</em>, <em>cat-blob</em>,
2048 or <em>ls</em> command respectively.
Junio C Hamano73d10512011-03-01 01:02:382049 Versions of fast-import not supporting the specified command
2050 will exit with a message indicating so.
Junio C Hamano0d75e872010-12-17 06:57:262051 This lets the import error out early with a clear message,
2052 rather than wasting time on the early part of an import
2053 before the unsupported command is detected.
2054</p>
2055</dd>
Junio C Hamano23e3f532011-02-10 02:05:292056<dt class="hdlist1">
2057notes
2058</dt>
2059<dd>
2060<p>
2061 Require that the backend support the <em>notemodify</em> (N)
2062 subcommand to the <em>commit</em> command.
2063 Versions of fast-import not supporting notes will exit
2064 with a message indicating so.
2065</p>
2066</dd>
Junio C Hamanofbc773c2011-08-02 00:09:122067<dt class="hdlist1">
2068done
2069</dt>
2070<dd>
2071<p>
2072 Error out if the stream ends without a <em>done</em> command.
2073 Without this feature, errors causing the frontend to end
2074 abruptly at a convenient point in the stream can go
Junio C Hamano8ce35d72012-09-18 22:30:422075 undetected. This may occur, for example, if an import
2076 front end dies in mid-operation without emitting SIGTERM
2077 or SIGKILL at its subordinate git fast-import instance.
Junio C Hamanofbc773c2011-08-02 00:09:122078</p>
2079</dd>
Junio C Hamano0d75e872010-12-17 06:57:262080</dl></div>
Junio C Hamano9d971152012-12-19 00:43:112081</div>
2082<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:532083<h3 id="_code_option_code"><code>option</code></h3>
Junio C Hamano68cf15a2010-11-06 01:01:592084<div class="paragraph"><p>Processes the specified option so that git fast-import behaves in a
2085way that suits the frontend&#8217;s needs.
Junio C Hamano6ce6b6c2010-01-18 01:25:502086Note that options specified by the frontend are overridden by any
2087options the user may specify to git fast-import itself.</p></div>
2088<div class="literalblock">
2089<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532090<pre><code> 'option' SP &lt;option&gt; LF</code></pre>
Junio C Hamano6ce6b6c2010-01-18 01:25:502091</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532092<div class="paragraph"><p>The <code>&lt;option&gt;</code> part of the command may contain any of the options
Junio C Hamano6ce6b6c2010-01-18 01:25:502093listed in the OPTIONS section that do not change import semantics,
Junio C Hamano92d80372016-07-13 22:00:052094without the leading <code>--</code> and is treated in the same way.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592095<div class="paragraph"><p>Option commands must be the first commands on the input (not counting
Junio C Hamano6ce6b6c2010-01-18 01:25:502096feature commands), to give an option command after any non-option
2097command is an error.</p></div>
Junio C Hamanoe1aeb5e2014-06-06 19:16:292098<div class="paragraph"><p>The following command-line options change import semantics and may therefore
Junio C Hamano6ce6b6c2010-01-18 01:25:502099not be passed as option:</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592100<div class="ulist"><ul>
Junio C Hamano6ce6b6c2010-01-18 01:25:502101<li>
2102<p>
2103date-format
2104</p>
2105</li>
2106<li>
2107<p>
2108import-marks
2109</p>
2110</li>
2111<li>
2112<p>
2113export-marks
2114</p>
2115</li>
2116<li>
2117<p>
Junio C Hamano0d75e872010-12-17 06:57:262118cat-blob-fd
2119</p>
2120</li>
2121<li>
2122<p>
Junio C Hamano6ce6b6c2010-01-18 01:25:502123force
2124</p>
2125</li>
2126</ul></div>
Junio C Hamano9d971152012-12-19 00:43:112127</div>
2128<div class="sect2">
Junio C Hamanoc14e6ad2014-10-31 20:25:532129<h3 id="_code_done_code"><code>done</code></h3>
2130<div class="paragraph"><p>If the <code>done</code> feature is not in use, treated as if EOF was read.
Junio C Hamanofbc773c2011-08-02 00:09:122131This can be used to tell fast-import to finish early.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532132<div class="paragraph"><p>If the <code>--done</code> command-line option or <code>feature done</code> command is
2133in use, the <code>done</code> command is mandatory and marks the end of the
Junio C Hamanofbc773c2011-08-02 00:09:122134stream.</p></div>
Junio C Hamanodfc4ce72007-02-07 23:17:292135</div>
Junio C Hamano9d971152012-12-19 00:43:112136</div>
2137</div>
2138<div class="sect1">
Junio C Hamano4eda1362012-04-23 20:55:492139<h2 id="_responses_to_commands">Responses To Commands</h2>
2140<div class="sectionbody">
2141<div class="paragraph"><p>New objects written by fast-import are not available immediately.
2142Most fast-import commands have no visible effect until the next
2143checkpoint (or completion). The frontend can send commands to
2144fill fast-import&#8217;s input pipe without worrying about how quickly
2145they will take effect, which improves performance by simplifying
2146scheduling.</p></div>
2147<div class="paragraph"><p>For some frontends, though, it is useful to be able to read back
2148data from the current repository as it is being updated (for
2149example when the source material describes objects in terms of
2150patches to be applied to previously imported objects). This can
2151be accomplished by connecting the frontend and fast-import via
2152bidirectional pipes:</p></div>
2153<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:112154<div class="content">
Junio C Hamano4eda1362012-04-23 20:55:492155<div class="literalblock">
2156<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532157<pre><code>mkfifo fast-import-output
Junio C Hamano4eda1362012-04-23 20:55:492158frontend &lt;fast-import-output |
Junio C Hamanoc14e6ad2014-10-31 20:25:532159git fast-import &gt;fast-import-output</code></pre>
Junio C Hamano4eda1362012-04-23 20:55:492160</div></div>
2161</div></div>
Junio C Hamanod7ed4042015-08-03 19:43:002162<div class="paragraph"><p>A frontend set up this way can use <code>progress</code>, <code>get-mark</code>, <code>ls</code>, and
2163<code>cat-blob</code> commands to read information from the import in progress.</p></div>
Junio C Hamano4eda1362012-04-23 20:55:492164<div class="paragraph"><p>To avoid deadlock, such frontends must completely consume any
Junio C Hamanod7ed4042015-08-03 19:43:002165pending output from <code>progress</code>, <code>ls</code>, <code>get-mark</code>, and <code>cat-blob</code> before
Junio C Hamano4eda1362012-04-23 20:55:492166performing writes to fast-import that might block.</p></div>
2167</div>
Junio C Hamano9d971152012-12-19 00:43:112168</div>
2169<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312170<h2 id="_crash_reports">Crash Reports</h2>
Junio C Hamano21391932008-02-16 10:02:542171<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592172<div class="paragraph"><p>If fast-import is supplied invalid input it will terminate with a
Junio C Hamano21391932008-02-16 10:02:542173non-zero exit status and create a crash report in the top level of
2174the Git repository it was importing into. Crash reports contain
2175a snapshot of the internal fast-import state as well as the most
Junio C Hamanoba4b9282008-07-06 05:20:312176recent commands that lead up to the crash.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592177<div class="paragraph"><p>All recent commands (including stream comments, file changes and
Junio C Hamano21391932008-02-16 10:02:542178progress commands) are shown in the command history within the crash
2179report, but raw file data and commit messages are excluded from the
2180crash report. This exclusion saves space within the report file
2181and reduces the amount of buffering that fast-import must perform
Junio C Hamanoba4b9282008-07-06 05:20:312182during execution.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592183<div class="paragraph"><p>After writing a crash report fast-import will close the current
Junio C Hamano21391932008-02-16 10:02:542184packfile and export the marks table. This allows the frontend
2185developer to inspect the repository state and resume the import from
2186the point where it crashed. The modified branches and tags are not
2187updated during a crash, as the import did not complete successfully.
2188Branch and tag information can be found in the crash report and
Junio C Hamanoba4b9282008-07-06 05:20:312189must be applied manually if the update is needed.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592190<div class="paragraph"><p>An example crash:</p></div>
Junio C Hamano21391932008-02-16 10:02:542191<div class="exampleblock">
Junio C Hamano9d971152012-12-19 00:43:112192<div class="content">
Junio C Hamano21391932008-02-16 10:02:542193<div class="literalblock">
2194<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532195<pre><code>$ cat &gt;in &lt;&lt;END_OF_INPUT
Junio C Hamano21391932008-02-16 10:02:542196# my very first test commit
2197commit refs/heads/master
2198committer Shawn O. Pearce &lt;spearce&gt; 19283 -0400
2199# who is that guy anyway?
2200data &lt;&lt;EOF
2201this is my commit
2202EOF
2203M 644 inline .gitignore
2204data &lt;&lt;EOF
2205.gitignore
2206EOF
2207M 777 inline bob
Junio C Hamanoc14e6ad2014-10-31 20:25:532208END_OF_INPUT</code></pre>
Junio C Hamano21391932008-02-16 10:02:542209</div></div>
2210<div class="literalblock">
2211<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532212<pre><code>$ git fast-import &lt;in
Junio C Hamano21391932008-02-16 10:02:542213fatal: Corrupt mode: M 777 inline bob
Junio C Hamanoc14e6ad2014-10-31 20:25:532214fast-import: dumping crash report to .git/fast_import_crash_8434</code></pre>
Junio C Hamano21391932008-02-16 10:02:542215</div></div>
2216<div class="literalblock">
2217<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532218<pre><code>$ cat .git/fast_import_crash_8434
Junio C Hamano21391932008-02-16 10:02:542219fast-import crash report:
2220 fast-import process: 8434
2221 parent process : 1391
Junio C Hamanoc14e6ad2014-10-31 20:25:532222 at Sat Sep 1 00:58:12 2007</code></pre>
Junio C Hamano21391932008-02-16 10:02:542223</div></div>
2224<div class="literalblock">
2225<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532226<pre><code>fatal: Corrupt mode: M 777 inline bob</code></pre>
Junio C Hamano21391932008-02-16 10:02:542227</div></div>
2228<div class="literalblock">
2229<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532230<pre><code>Most Recent Commands Before Crash
Junio C Hamano21391932008-02-16 10:02:542231---------------------------------
2232 # my very first test commit
2233 commit refs/heads/master
2234 committer Shawn O. Pearce &lt;spearce&gt; 19283 -0400
2235 # who is that guy anyway?
2236 data &lt;&lt;EOF
2237 M 644 inline .gitignore
2238 data &lt;&lt;EOF
Junio C Hamanoc14e6ad2014-10-31 20:25:532239* M 777 inline bob</code></pre>
Junio C Hamano21391932008-02-16 10:02:542240</div></div>
2241<div class="literalblock">
2242<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532243<pre><code>Active Branch LRU
Junio C Hamano21391932008-02-16 10:02:542244-----------------
Junio C Hamanoc14e6ad2014-10-31 20:25:532245 active_branches = 1 cur, 5 max</code></pre>
Junio C Hamano21391932008-02-16 10:02:542246</div></div>
2247<div class="literalblock">
2248<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532249<pre><code>pos clock name
Junio C Hamano21391932008-02-16 10:02:542250~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamanoc14e6ad2014-10-31 20:25:532251 1) 0 refs/heads/master</code></pre>
Junio C Hamano21391932008-02-16 10:02:542252</div></div>
2253<div class="literalblock">
2254<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532255<pre><code>Inactive Branches
Junio C Hamano21391932008-02-16 10:02:542256-----------------
2257refs/heads/master:
2258 status : active loaded dirty
2259 tip commit : 0000000000000000000000000000000000000000
2260 old tree : 0000000000000000000000000000000000000000
2261 cur tree : 0000000000000000000000000000000000000000
2262 commit clock: 0
Junio C Hamanoc14e6ad2014-10-31 20:25:532263 last pack :</code></pre>
Junio C Hamano21391932008-02-16 10:02:542264</div></div>
2265<div class="literalblock">
2266<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:532267<pre><code>-------------------
2268END OF CRASH REPORT</code></pre>
Junio C Hamano21391932008-02-16 10:02:542269</div></div>
2270</div></div>
2271</div>
Junio C Hamano9d971152012-12-19 00:43:112272</div>
2273<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312274<h2 id="_tips_and_tricks">Tips and Tricks</h2>
Junio C Hamanodfc4ce72007-02-07 23:17:292275<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592276<div class="paragraph"><p>The following tips and tricks have been collected from various
Junio C Hamanoba4b9282008-07-06 05:20:312277users of fast-import, and are offered here as suggestions.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112278<div class="sect2">
2279<h3 id="_use_one_mark_per_commit">Use One Mark Per Commit</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592280<div class="paragraph"><p>When doing a repository conversion, use a unique mark per commit
Junio C Hamanoc14e6ad2014-10-31 20:25:532281(<code>mark :&lt;n&gt;</code>) and supply the --export-marks option on the command
Junio C Hamanod3339982007-02-09 08:38:482282line. fast-import will dump a file which lists every mark and the Git
Junio C Hamanodfc4ce72007-02-07 23:17:292283object SHA-1 that corresponds to it. If the frontend can tie
2284the marks back to the source repository, it is easy to verify the
2285accuracy and completeness of the import by comparing each Git
Junio C Hamanoba4b9282008-07-06 05:20:312286commit to the corresponding source revision.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592287<div class="paragraph"><p>Coming from a system such as Perforce or Subversion this should be
Junio C Hamanod3339982007-02-09 08:38:482288quite simple, as the fast-import mark can also be the Perforce changeset
Junio C Hamanoba4b9282008-07-06 05:20:312289number or the Subversion revision number.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112290</div>
2291<div class="sect2">
2292<h3 id="_freely_skip_around_branches">Freely Skip Around Branches</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592293<div class="paragraph"><p>Don&#8217;t bother trying to optimize the frontend to stick to one branch
Junio C Hamanodfc4ce72007-02-07 23:17:292294at a time during an import. Although doing so might be slightly
Junio C Hamanod3339982007-02-09 08:38:482295faster for fast-import, it tends to increase the complexity of the frontend
Junio C Hamanoba4b9282008-07-06 05:20:312296code considerably.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592297<div class="paragraph"><p>The branch LRU builtin to fast-import tends to behave very well, and the
Junio C Hamanodfc4ce72007-02-07 23:17:292298cost of activating an inactive branch is so low that bouncing around
Junio C Hamanoba4b9282008-07-06 05:20:312299between branches has virtually no impact on import performance.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112300</div>
2301<div class="sect2">
2302<h3 id="_handling_renames">Handling Renames</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592303<div class="paragraph"><p>When importing a renamed file or directory, simply delete the old
Junio C Hamano9dd8bb02007-02-12 07:15:352304name(s) and modify the new name(s) during the corresponding commit.
2305Git performs rename detection after-the-fact, rather than explicitly
Junio C Hamanoba4b9282008-07-06 05:20:312306during a commit.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112307</div>
2308<div class="sect2">
2309<h3 id="_use_tag_fixup_branches">Use Tag Fixup Branches</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592310<div class="paragraph"><p>Some other SCM systems let the user create a tag from multiple
Junio C Hamanodfc4ce72007-02-07 23:17:292311files which are not from the same commit/changeset. Or to create
Junio C Hamanoba4b9282008-07-06 05:20:312312tags which are a subset of the files available in the repository.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592313<div class="paragraph"><p>Importing these tags as-is in Git is impossible without making at
Junio C Hamano9d971152012-12-19 00:43:112314least one commit which &#8220;fixes up&#8221; the files to match the content
Junio C Hamanoc14e6ad2014-10-31 20:25:532315of the tag. Use fast-import&#8217;s <code>reset</code> command to reset a dummy branch
Junio C Hamanodfc4ce72007-02-07 23:17:292316outside of your normal branch space to the base commit for the tag,
2317then commit one or more file fixup commits, and finally tag the
Junio C Hamanoba4b9282008-07-06 05:20:312318dummy branch.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532319<div class="paragraph"><p>For example since all normal branches are stored under <code>refs/heads/</code>
2320name the tag fixup branch <code>TAG_FIXUP</code>. This way it is impossible for
Junio C Hamanodfc4ce72007-02-07 23:17:292321the fixup branch used by the importer to have namespace conflicts
Junio C Hamanoc14e6ad2014-10-31 20:25:532322with real branches imported from the source (the name <code>TAG_FIXUP</code>
2323is not <code>refs/heads/TAG_FIXUP</code>).</p></div>
2324<div class="paragraph"><p>When committing fixups, consider using <code>merge</code> to connect the
Junio C Hamanodfc4ce72007-02-07 23:17:292325commit(s) which are supplying file revisions to the fixup branch.
Junio C Hamano1aa40d22010-01-21 17:46:432326Doing so will allow tools such as <em>git blame</em> to track
Junio C Hamanodfc4ce72007-02-07 23:17:292327through the real commit history and properly annotate the source
Junio C Hamanoba4b9282008-07-06 05:20:312328files.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:532329<div class="paragraph"><p>After fast-import terminates the frontend will need to do <code>rm .git/TAG_FIXUP</code>
Junio C Hamanoba4b9282008-07-06 05:20:312330to remove the dummy branch.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112331</div>
2332<div class="sect2">
2333<h3 id="_import_now_repack_later">Import Now, Repack Later</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592334<div class="paragraph"><p>As soon as fast-import completes the Git repository is completely valid
Junio C Hamanoa6387422007-08-25 03:54:272335and ready for use. Typically this takes only a very short time,
Junio C Hamanoba4b9282008-07-06 05:20:312336even for considerably large projects (100,000+ commits).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592337<div class="paragraph"><p>However repacking the repository is necessary to improve data
Junio C Hamanodfc4ce72007-02-07 23:17:292338locality and access performance. It can also take hours on extremely
2339large projects (especially if -f and a large --window parameter is
2340used). Since repacking is safe to run alongside readers and writers,
2341run the repack in the background and let it finish when it finishes.
Junio C Hamanoba4b9282008-07-06 05:20:312342There is no reason to wait to explore your new Git project!</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592343<div class="paragraph"><p>If you choose to wait for the repack, don&#8217;t try to run benchmarks
Junio C Hamanod3339982007-02-09 08:38:482344or performance tests until repacking is completed. fast-import outputs
Junio C Hamanodfc4ce72007-02-07 23:17:292345suboptimal packfiles that are simply never seen in real use
Junio C Hamanoba4b9282008-07-06 05:20:312346situations.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112347</div>
2348<div class="sect2">
2349<h3 id="_repacking_historical_data">Repacking Historical Data</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592350<div class="paragraph"><p>If you are repacking very old imported data (e.g. older than the
Junio C Hamanodfc4ce72007-02-07 23:17:292351last year), consider expending some extra CPU time and supplying
Junio C Hamano1aa40d22010-01-21 17:46:432352--window=50 (or higher) when you run <em>git repack</em>.
Junio C Hamanodfc4ce72007-02-07 23:17:292353This will take longer, but will also produce a smaller packfile.
2354You only need to expend the effort once, and everyone using your
Junio C Hamanoba4b9282008-07-06 05:20:312355project will benefit from the smaller repository.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112356</div>
2357<div class="sect2">
2358<h3 id="_include_some_progress_messages">Include Some Progress Messages</h3>
Junio C Hamanoc14e6ad2014-10-31 20:25:532359<div class="paragraph"><p>Every once in a while have your frontend emit a <code>progress</code> message
Junio C Hamanoe52cf782007-08-19 19:15:522360to fast-import. The contents of the messages are entirely free-form,
2361so one suggestion would be to output the current month and year
2362each time the current commit date moves into the next month.
2363Your users will feel better knowing how much of the data stream
Junio C Hamanoba4b9282008-07-06 05:20:312364has been processed.</p></div>
Junio C Hamanodf60f442007-02-07 05:52:372365</div>
Junio C Hamano9d971152012-12-19 00:43:112366</div>
2367</div>
2368<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312369<h2 id="_packfile_optimization">Packfile Optimization</h2>
Junio C Hamanodf60f442007-02-07 05:52:372370<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592371<div class="paragraph"><p>When packing a blob fast-import always attempts to deltify against the last
Junio C Hamanodf60f442007-02-07 05:52:372372blob written. Unless specifically arranged for by the frontend,
2373this will probably not be a prior version of the same file, so the
2374generated delta will not be the smallest possible. The resulting
Junio C Hamanoba4b9282008-07-06 05:20:312375packfile will be compressed, but will not be optimal.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592376<div class="paragraph"><p>Frontends which have efficient access to all revisions of a
Junio C Hamanodf60f442007-02-07 05:52:372377single file (for example reading an RCS/CVS ,v file) can choose
2378to supply all revisions of that file as a sequence of consecutive
Junio C Hamanoc14e6ad2014-10-31 20:25:532379<code>blob</code> commands. This allows fast-import to deltify the different file
Junio C Hamanodf60f442007-02-07 05:52:372380revisions against each other, saving space in the final packfile.
2381Marks can be used to later identify individual file revisions during
Junio C Hamanoc14e6ad2014-10-31 20:25:532382a sequence of <code>commit</code> commands.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592383<div class="paragraph"><p>The packfile(s) created by fast-import do not encourage good disk access
Junio C Hamanod3339982007-02-09 08:38:482384patterns. This is caused by fast-import writing the data in the order
Junio C Hamanodf60f442007-02-07 05:52:372385it is received on standard input, while Git typically organizes
2386data within packfiles to make the most recent (current tip) data
2387appear before historical data. Git also clusters commits together,
Junio C Hamanoba4b9282008-07-06 05:20:312388speeding up revision traversal through better cache locality.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592389<div class="paragraph"><p>For this reason it is strongly recommended that users repack the
Junio C Hamanoc14e6ad2014-10-31 20:25:532390repository with <code>git repack -a -d</code> after fast-import completes, allowing
Junio C Hamanodf60f442007-02-07 05:52:372391Git to reorganize the packfiles for faster data access. If blob
Junio C Hamanoc14e6ad2014-10-31 20:25:532392deltas are suboptimal (see above) then also adding the <code>-f</code> option
Junio C Hamanodf60f442007-02-07 05:52:372393to force recomputation of all deltas can significantly reduce the
Junio C Hamanoba4b9282008-07-06 05:20:312394final packfile size (30-50% smaller can be quite typical).</p></div>
Junio C Hamanodf60f442007-02-07 05:52:372395</div>
Junio C Hamano9d971152012-12-19 00:43:112396</div>
2397<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312398<h2 id="_memory_utilization">Memory Utilization</h2>
Junio C Hamanodf60f442007-02-07 05:52:372399<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:592400<div class="paragraph"><p>There are a number of factors which affect how much memory fast-import
Junio C Hamanodf60f442007-02-07 05:52:372401requires to perform an import. Like critical sections of core
Junio C Hamanoa6387422007-08-25 03:54:272402Git, fast-import uses its own memory allocators to amortize any overheads
2403associated with malloc. In practice fast-import tends to amortize any
Junio C Hamanoba4b9282008-07-06 05:20:312404malloc overheads to 0, due to its use of large block allocations.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112405<div class="sect2">
2406<h3 id="_per_object">per object</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592407<div class="paragraph"><p>fast-import maintains an in-memory structure for every object written in
Junio C Hamanodf60f442007-02-07 05:52:372408this execution. On a 32 bit system the structure is 32 bytes,
2409on a 64 bit system the structure is 40 bytes (due to the larger
2410pointer sizes). Objects in the table are not deallocated until
Junio C Hamanod3339982007-02-09 08:38:482411fast-import terminates. Importing 2 million objects on a 32 bit system
Junio C Hamanoba4b9282008-07-06 05:20:312412will require approximately 64 MiB of memory.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592413<div class="paragraph"><p>The object table is actually a hashtable keyed on the object name
Junio C Hamanod3339982007-02-09 08:38:482414(the unique SHA-1). This storage configuration allows fast-import to reuse
Junio C Hamanodf60f442007-02-07 05:52:372415an existing or already written object and avoid writing duplicates
2416to the output packfile. Duplicate blobs are surprisingly common
Junio C Hamanoba4b9282008-07-06 05:20:312417in an import, typically due to branch merges in the source.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112418</div>
2419<div class="sect2">
2420<h3 id="_per_mark">per mark</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592421<div class="paragraph"><p>Marks are stored in a sparse array, using 1 pointer (4 bytes or 8
Junio C Hamanodf60f442007-02-07 05:52:372422bytes, depending on pointer size) per mark. Although the array
2423is sparse, frontends are still strongly encouraged to use marks
2424between 1 and n, where n is the total number of marks required for
Junio C Hamanoba4b9282008-07-06 05:20:312425this import.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112426</div>
2427<div class="sect2">
2428<h3 id="_per_branch">per branch</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592429<div class="paragraph"><p>Branches are classified as active and inactive. The memory usage
Junio C Hamanoba4b9282008-07-06 05:20:312430of the two classes is significantly different.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592431<div class="paragraph"><p>Inactive branches are stored in a structure which uses 96 or 120
Junio C Hamanodf60f442007-02-07 05:52:372432bytes (32 bit or 64 bit systems, respectively), plus the length of
Junio C Hamanod3339982007-02-09 08:38:482433the branch name (typically under 200 bytes), per branch. fast-import will
Junio C Hamanodf60f442007-02-07 05:52:372434easily handle as many as 10,000 inactive branches in under 2 MiB
Junio C Hamanoba4b9282008-07-06 05:20:312435of memory.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592436<div class="paragraph"><p>Active branches have the same overhead as inactive branches, but
Junio C Hamanodf60f442007-02-07 05:52:372437also contain copies of every tree that has been recently modified on
Junio C Hamanoc14e6ad2014-10-31 20:25:532438that branch. If subtree <code>include</code> has not been modified since the
Junio C Hamanodf60f442007-02-07 05:52:372439branch became active, its contents will not be loaded into memory,
Junio C Hamanoc14e6ad2014-10-31 20:25:532440but if subtree <code>src</code> has been modified by a commit since the branch
Junio C Hamanoba4b9282008-07-06 05:20:312441became active, then its contents will be loaded in memory.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592442<div class="paragraph"><p>As active branches store metadata about the files contained on that
Junio C Hamanodf60f442007-02-07 05:52:372443branch, their in-memory storage size can grow to a considerable size
Junio C Hamanoba4b9282008-07-06 05:20:312444(see below).</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592445<div class="paragraph"><p>fast-import automatically moves active branches to inactive status based on
Junio C Hamanodf60f442007-02-07 05:52:372446a simple least-recently-used algorithm. The LRU chain is updated on
Junio C Hamanoc14e6ad2014-10-31 20:25:532447each <code>commit</code> command. The maximum number of active branches can be
Junio C Hamanoba4b9282008-07-06 05:20:312448increased or decreased on the command line with --active-branches=.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112449</div>
2450<div class="sect2">
2451<h3 id="_per_active_tree">per active tree</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592452<div class="paragraph"><p>Trees (aka directories) use just 12 bytes of memory on top of the
Junio C Hamanodf60f442007-02-07 05:52:372453memory required for their entries (see &#8220;per active file&#8221; below).
Junio C Hamanoa6387422007-08-25 03:54:272454The cost of a tree is virtually 0, as its overhead amortizes out
Junio C Hamanoba4b9282008-07-06 05:20:312455over the individual file entries.</p></div>
Junio C Hamano9d971152012-12-19 00:43:112456</div>
2457<div class="sect2">
2458<h3 id="_per_active_file_entry">per active file entry</h3>
Junio C Hamano68cf15a2010-11-06 01:01:592459<div class="paragraph"><p>Files (and pointers to subtrees) within active trees require 52 or 64
Junio C Hamanodf60f442007-02-07 05:52:372460bytes (32/64 bit platforms) per entry. To conserve space, file and
2461tree names are pooled in a common string table, allowing the filename
2462&#8220;Makefile&#8221; to use just 16 bytes (after including the string header
Junio C Hamanoba4b9282008-07-06 05:20:312463overhead) no matter how many times it occurs within the project.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:592464<div class="paragraph"><p>The active branch LRU, when coupled with the filename string pool
Junio C Hamanod3339982007-02-09 08:38:482465and lazy loading of subtrees, allows fast-import to efficiently import
Junio C Hamanodf60f442007-02-07 05:52:372466projects with 2,000+ branches and 45,114+ files in a very limited
Junio C Hamanoba4b9282008-07-06 05:20:312467memory footprint (less than 2.7 MiB per active branch).</p></div>
Junio C Hamanodf60f442007-02-07 05:52:372468</div>
Junio C Hamano9d971152012-12-19 00:43:112469</div>
2470</div>
2471<div class="sect1">
Junio C Hamano0d75e872010-12-17 06:57:262472<h2 id="_signals">Signals</h2>
2473<div class="sectionbody">
2474<div class="paragraph"><p>Sending <strong>SIGUSR1</strong> to the <em>git fast-import</em> process ends the current
Junio C Hamanoc14e6ad2014-10-31 20:25:532475packfile early, simulating a <code>checkpoint</code> command. The impatient
Junio C Hamano0d75e872010-12-17 06:57:262476operator can use this facility to peek at the objects and refs from an
2477import in progress, at the cost of some added running time and worse
2478compression.</p></div>
2479</div>
Junio C Hamano9d971152012-12-19 00:43:112480</div>
2481<div class="sect1">
Junio C Hamano13220242014-11-19 23:06:272482<h2 id="_see_also">SEE ALSO</h2>
2483<div class="sectionbody">
2484<div class="paragraph"><p><a href="git-fast-export.html">git-fast-export(1)</a></p></div>
2485</div>
2486</div>
2487<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:312488<h2 id="_git">GIT</h2>
Junio C Hamanodf60f442007-02-07 05:52:372489<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:232490<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanodf60f442007-02-07 05:52:372491</div>
Junio C Hamano7bd050f2011-09-22 06:32:222492</div>
Junio C Hamano9d971152012-12-19 00:43:112493</div>
Junio C Hamano7bd050f2011-09-22 06:32:222494<div id="footnotes"><hr /></div>
Junio C Hamanodf60f442007-02-07 05:52:372495<div id="footer">
2496<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:532497Last updated
2498 2018-01-26 15:11:04 PST
Junio C Hamanodf60f442007-02-07 05:52:372499</div>
2500</div>
2501</body>
2502</html>